Main Page   Compound List   File List   Compound 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 // The following class defines the scheduler/dispatcher abstraction -- 
00017 // the data structures and operations needed to keep track of which 
00018 // thread is running, and which threads are ready but not running.
00019 
00020 class Scheduler {
00021   public:
00022     Scheduler();                        // Initialize list of ready threads 
00023     ~Scheduler();                       // De-allocate ready list
00024 
00025     void ReadyToRun(Thread* thread);    // Thread can be dispatched.
00026     Thread* FindNextToRun();            // Dequeue first thread on the ready 
00027                                         // list, if any, and return thread.
00028     void Run(Thread* nextThread);       // Cause nextThread to start running
00029     void Print();                       // Print contents of ready list
00030     
00031   private:
00032     List *readyList;            // queue of threads that are ready to run,
00033                                 // but not running
00034 };
00035 
00036 #endif // SCHEDULER_H

Generated on Mon Feb 10 09:54:47 2003 for nachos by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002
The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees