Suppose you are developing the scheduler for a real time system andhave the stru
ID: 3611285 • Letter: S
Question
Suppose you are developing the scheduler for a real time system andhave the struct:struct process
{
int process_id;
long deadline;
long wcet; // worst-case estimated time
/* other desired fields */
}
and you need to identify the process that needs to run the soonestin order to meet its deadline (ex. the one that has the smallestvalue of deadline - wcet).
Write code for thepriority queue enqueue function for a minimum heap containingpointers to process struct using deadline - wcet as thepriority.
Explanation / Answer
Suppose you are developing the scheduler for a real time system andhave the stru