//////////////////////////////////////////////////////////////////////////// // PROCESS.H // //-The process class contains all the object need to run a single process // in its own address space. // // The process class contain: // -AddressSpace // -Count of threads still alive. // -OpenFile Table // -Join Information // -Page Table Location /////////////////////////////////////////////////////////////////////////// #ifndef PROCESS_H_ #define PROCESS_H_ //#include "system.h" #include "addrspace.h" #include "openfile.h" #include "synch.h" #include "queue.h" typedef queue THREAD_QUEUE; class Process { public: Process(OpenFile *executable, bool joinable=false); ~Process(); int getThreadCount(); void incrementThreadCount(); void decrementThreadCount(); int getPID(); AddrSpace* getSpace(); OpenFile* openFileTable[10]; char* argBuffer; void processFinish(); void Join(Thread* waitingThread); bool isFinished() { return finished; } private: AddrSpace* addrSpace; int threadCount; int PID; bool finished; THREAD_QUEUE waitingThreads; static Lock* joinLock; protected: static int processID; }; #endif