Question: Please code in C++ or Java An operating system's pad manager is responsible for managing process identifiers. When a process is first created, it is

Please code in C++ or Java

Please code in C++ or Java An operating system's pad manager is

An operating system's pad manager is responsible for managing process identifiers. When a process is first created, it is assigned a unique pad by the pad manager. the pad is returned to the pad manager when the process completes execution, and the manager may later reassign this pad. 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 pad. Use the following constants to identify the range of possible pad values: #define MIN_PID 300 #define MAX_PID 5000 You may use any data structure of your choice to represent the availability of process identifiers. One strategy is to adopt what Linux has done and use a bitmap in which a value of 0 at 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. Implement the following API for obtaining and releasing a pad: int allocate_ map (void)-Creates and initializes a data structure for representing pads; returns-1 if unsuccessful, 1 if successful int allocate_ pid(void)-Allocates and returns a pad; returns-1 if unable to allocate a pad (all pads are in use) void release_pid(int pid)-Releases a pad

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!