Question: How to implement process control block (PCB) into a program that is a non preemptive scheduling program. 5 1/* Special enumerated data type for process

How to implement process control block (PCB) into a program that is a non preemptive scheduling program.

5 1/* Special enumerated data type for process state */ 2 typedef

5 1/* Special enumerated data type for process state */ 2 typedef enum { 3 } process_state_t; 1. has a pre-defined total service time, and 2. does not use I/O and can never be in a blocked state, and 3. will eventually run to completion and does not encounter any errors (e.g. segmentation faults). Each process should be represented within your program as a process control block (PCB) instance defined as follows: 12 6 /* C data structure used as process control block. The scheduler 7 *should create one instance per running process system. 13 14 15 16 READY, RUNNING, EXIT 8 */ 9 typedef struct { 10 char process_name [11]; // A string that identifies the process 11 /* Times are measured in seconds. */ int entry Time; // The time process entered system int service Time; // The total CPU time required by the process int remaining Time; // Remaining service time until completion. process_state_t state; // current process state (e.g. READY). 17 18 pcb_t;

Step by Step Solution

3.48 Rating (165 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

For a nonpreemptive scheduling program with a predefined total service time and without IO or errors you can implement a simple simulation using a PCB ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Operating System Questions!