// sched.h // // ABC for scheduler parts. // macro guard #ifndef __SCHED_H #define __SCHED_H #include "linkedlist.h" typedef struct { int start_time; int exit_time; int execution_time; int time_remaining; } pcb; class sched // scheduler will be run every time cycle { public: virtual void schedule(int nextproc, int timeindex, linked_list* run) = 0; // nextproc is the execution time of the next process // timeindex is the current clock // run is a pointer to the run queue }; // ------------------------------------------------------------- class fcfs : public sched { // first come first served scheduling algorithm public: void schedule(int nextproc, int timeindex, linked_list* run); }; // ------------------------------------------------------------- class rr : public sched // round-robin scheduling algorithm { public: void schedule(int nextproc, int timeindex, linked_list* run); }; // ------------------------------------------------------------- class sjn : public sched // shortest job next scheduling algorithm { public: void schedule(int nextproc, int timeindex, linked_list* run); }; #endif