Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

File View Edit Go Window Tools Help Q Q Q Search N HW #1 Programming Problem 3.20.pdf 1 page HW#1 Programming Problem 3.20 CISC 3320

image text in transcribed
File View Edit Go Window Tools Help Q Q Q Search N HW #1 Programming Problem 3.20.pdf 1 page HW#1 Programming Problem 3.20 CISC 3320 ET6 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 must be unique; no two active processes may have the same pid. Use the following constants to identify the range of possible pid 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 O at position / indicates that a process id of value / is available and a value of 1 indicates that the process id is currently in use. Implement the following API for obtaining and relesing a pid: int allocate_map(void) - Creates and initializes a data structure for representing pids; returns -1 if unsuccessful and 1 if successful int allocate_pid(void) - Allocates and returns a pid; returns -1 if if unable to allocate a pid (all pids are in use) void release_pid (int_pid) - Releases a pid

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

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions