Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Code in C, with comments throughout so I can follow with what is happening. Thank you. n operating system's pid manager is responsible for

Please Code in C, with comments throughout so I can follow with what is happening.

Thank you.

image text in transcribed

n 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 #define MIN.PID 300 #define MAXPID 5000 You may use any data structure of your choice to represent the avail- ability 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 . int allocate.nap (void)-Creates and initializes a data structure . int allocate-Pid (void)--Allocates and returns apid;returns void release-pid(int pid)-Releases a pid Implement the following API for obtaining and releasing a pid for representing pids; returns-1 if unsuccessful, 1 if successful 1 if unable to allocate a pid (all pids are in use)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions

Question

=+7 What is the overall cost of the international assignment?

Answered: 1 week ago