Question: Please write in c An operating system's pid manager is responsible for managing process identifiers. When a process is first created, it is assigned a

Please write in c

Please write in c An operating system's pid manager is responsible for

An operating system's pid manager is responsible for managing process identifiers. When a process is first created, it is assigned a unique pid by the pid manager. The pid is returned to the pid manager when the process completes execution, and the manager may later reassign this pid. Process identifiers are discussed more fully in Section 3.3.1. What is most important here is to recognize that process identifiers must be unique; no two active processes can have the same pid. Use the following constants to identify the range of possible pid values (for testing these values may be changed, your code must be able to deal with the changes): #define MIN_PID 300 #define MAX_PID 5000 You must use a linked list. Implement the following API for obtaining and releasing a pid: int allocate_map(void)-Creates and initializes a data structure for representing pids; returns -1 if unsuccessful, 1 if successful. (Hint: review what is meant by an empty linked list. The solution here is trivial, don't over think) fint allocate_pid(void)-Allocates and returns a pid; returns -1 if unable to allocate a pid (all pids are in use) 1P2004 Assignment 2 Winter 2021 void release_pid (int pid) - Releases a pid This programming problem will be modified in Chapter 4 and in Chapter 6

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!