Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * PCB.h
- *
- * Created on: May 7, 2018
- * Author: OS1
- */
- #ifndef PCB_H_
- #define PCB_H_
- #include <stdio.h>
- #include <dos.h>
- #include "Define.h"
- #include "Queue.h"
- #include "Thread.h"
- //currently running thread
- PCB* running;
- //if all threads are either blocked or sleeping use this thread
- //PCB* defaultThread = new Thread();
- //forward declaration of the necessary classes
- class Thread;
- class List;
- class PCB {
- public:
- /********************************************************/
- /* Methods */
- //PCB constructor
- PCB(Thread *myThread, StackSize stackSize = defaultStackSize, Time timeSlice = defaultTimeSlice);
- void wrapper();
- /*********************************************************/
- /* Atributes */
- unsigned *stack;
- unsigned ss, sp, bp;
- //Number of time quantums that this Thread gets
- Time timeSlice;
- //Time to sleep
- Time sleepTime;
- //Flag that describe the state of the Thread
- volatile int state;
- //Pointer to the thread that this pcb describes
- Thread *myThread;
- //Threads that are waiting for this one
- Queue* waitQueue;
- //ID
- ID id;
- /********************************************************/
- };
- #endif /* PCB_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement