Question: s rev testinput.txt s ./MyRev testInput.txt P2) An operating system usually has a pid_manager which is responsible for managing process identifiers. When a process is

 s rev testinput.txt s ./MyRev testInput.txt P2) An operating system usually

s rev testinput.txt s ./MyRev testInput.txt P2) An operating system usually has a pid_manager which is responsible for managing process identifiers. When a process is first created, it s 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 to a new process. It is very important though, that no two active processes can have the same pid. Even though this is not the best implementation, please use an array of characters to represent and track the availability of the pid numbers. A'0 in position i indicates that a process id of value i is available and a value of '1' indicates that the process id is currently in use. A better strategy is to adopt what Linux does and use a bitmap instead of the character array Implement the following functions to obtain and release a pid: it nu oesto ra tvo d Creates and ntilizts adata structurorepreseting pids returns -1 if unsuccessful, 1 if successful . int allocate pid (void): Allocates and returns a pid; returns -1 if unable to allocate a pid (all pids are in use) int release_pid(int pid) : Releases a pid Write a short main program to test your functions and use the following range for the available pid numbers tdefine MIN PID 300 #define MAXPID 5000

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!