Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

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

Students also viewed these Databases questions

Question

Find dy/dx if x = te, y = 2t2 +1

Answered: 1 week ago

Question

What were the reasons for your conversion or resistance?

Answered: 1 week ago

Question

1. Who should participate and how will participants be recruited?

Answered: 1 week ago