Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the code below of the two processes P 1 and P 2 . Which of the following initial values of S and Q may

Consider the code below of the two processes P1 and P2. Which of the following initial values
of S and Q may cause indefinite blocking for one or both processes.
(a)S=2,Q=2
(b)S=2,Q=1
(c)S=1,Q=2
(d)S=1,Q=1
(e) None of the above
Assume that a semaphore named "S" already exists. The result of calling sem_open as shown
below is
#define PERMS (mode_t)(S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
#define FLAGS (0_CREAT)
...
sem_open ("S", FLAGS, PERMS, 2);
(a) Changing the permissions on the existing semaphore to PERMS, and setting its value to 2
(b) Ignoring PERMS and setting the value of the semaphore is 2
(c) Both PERMS and the value (that is 2) will be ignored
(d) A new semaphore with is created with the same name, and its access permissions are set
to PERMS and its initial value is set to 2
(e) None of the above
Which of the following functions is used to remove a named semaphore from the system?
(a) sem_unlink
(b) sem_destroy
(c) sem_close
(d) None of the above
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

State the uses of job description.

Answered: 1 week ago

Question

Explain in detail the different methods of performance appraisal .

Answered: 1 week ago