Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the example of producer-and-consumer problem (slide-31), which semaphore is used to implement a critical section for the shared variable, buffer? s n e all

image text in transcribed

  1. In the example of producer-and-consumer problem (slide-31), which semaphore is used to implement a critical section for the shared variable, buffer?
    1. s
    2. n
    3. e
    4. all of them
    5. None of tem

  1. Deadlock may happen due to
    1. User consumes too much resource
    2. User holds some resources and waits for more
    3. System does not have shared resources
    4. There are no mutual exclusions of user processes
    5. Users hate each other.

  1. Which of the following OS scheduling policy has the worst performance (response time)?
    1. Shortest Job First
    2. Round Robin with fixed quantum
    3. Round Robin with variable quantum
    4. First-Come-First-Serve
    5. No difference, all are about the same

  1. How does OS resolve the problem of starvation of low priority jobs in the priority scheduling policy?
    1. Request the user to resubmit the job with a higher priority
    2. Continue waiting until the high priority jobs are completed.
    3. Increate the priority of aging process in the Ready state.
    4. Allocate more CPU time to do processing.
    5. Stop the preemptive scheduling when there are too many aging processes.

var s: semaphore (1); /* critical section */ n: semaphore (0); /* underflow */ e: semaphore (sizeofbuffer); /* overflow */ procedure producer; begin repeat produce item for buffer; wait(e); wait(s); append to buffer; signal(s); signal(n); forever; end; procedure consumer; begin repeat wait(n); wait(s); take from buffer; signal(s); signal(e); consume item forever; end; 10/03/2019 TDC411-04

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

Mastering Big Data Interview 751 Comprehensive Questions And Expert Answers

Authors: Mr Bhanu Pratap Mahato

1st Edition

B0CLNT3NVD, 979-8865047216

More Books

Students also viewed these Databases questions