Main Page | Alphabetical List | Class List | File List | Class Members | File Members

scheduler.h

Go to the documentation of this file.
00001 // scheduler.h 00002 // Data structures for the thread dispatcher and scheduler. 00003 // Primarily, the list of threads that are ready to run. 00004 // 00005 // Copyright (c) 1992-1993 The Regents of the University of California. 00006 // All rights reserved. See copyright.h for copyright notice and limitation 00007 // of liability and disclaimer of warranty provisions. 00008 00009 #ifndef SCHEDULER_H 00010 #define SCHEDULER_H 00011 00012 #include "copyright.h" 00013 #include "list.h" 00014 #include "thread.h" 00015 00016 00017 00018 extern sigset_t timer_mask; 00019 #define SCHED() siglongjmp(schd_jmp, 1) 00020 00021 void SetPreemption(); 00022 void timerInit(); 00023 void schedule(); 00024 // The following class defines the scheduler/dispatcher abstraction -- 00025 // the data structures and operations needed to keep track of which 00026 // thread is running, and which threads are ready but not running. 00027 00028 class Scheduler 00029 { 00030 public: 00031 Scheduler(); // Initialize list of ready threads 00032 ~Scheduler(); // De-allocate ready list 00033 00034 void ReadyToRun(Thread *thread); // Thread can be dispatched. 00035 Thread* FindNextToRun(); // Dequeue first thread on the ready 00036 // list, if any, and return thread. 00037 void Print(); // Print contents of ready list 00038 int IsEmpty(); 00039 00040 static void timerIntH(int sig); 00041 00042 00043 private: 00044 List *readyList; // queue of threads that are ready to run, but not running 00045 00046 // new additions 00047 00048 }; 00049 00050 #endif // SCHEDULER_H

Generated on Thu Sep 16 12:33:45 2004 for NachOS by doxygen 1.3.8