Homework : Operating System Concepts • Using kernel objects (such as semaphore, critical section, mutex lock, event ) to realize reader-writer problem. • As for mutex locks, semaphores see example.cpp.
Added by Bill G.
Close
Step 1
The reader-writer problem is a classic synchronization problem in computer science. It involves multiple threads, where some threads are readers and others are writers. Readers can read data simultaneously, but writers must have exclusive access to write data. The Show more…
Show all steps
Your feedback will help us improve your experience
Madhur L and 98 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
All processes share a semaphore variable mutex, initialized to 1. Each process must execute wait(mutex) before entering the critical section and signal(mutex) afterward. Suppose a process executes in the following manner: signal(mutex), critical section wait(mutex), In this situation: a deadlock will occur processes will starve to enter the critical section several processes may be executing in their critical section all of the mentioned
Madhur L.
It is found that a program has multiple critical sections. Choose correct statements from below: (i) Multiple semaphores are needed for handling the situation. (ii) A single semaphore that uncompresses all the critical section is sufficient and is also more efficient. (iii) To get better control of the code, monitors need to be implemented. (A) (i) and (ii) (B) (ii) and (iii) (C) (i) and (iii) (D) (i), (ii), (iii)
OPERATING SYSTEM
INTERPROCESS COMMUNICATION, CONCURRENCY AND SYNCHRONIZATION
A process using a semaphore has a start value of 1 for its semaphore. Since the start of execution of the program, 12 signal operations were completed. How many wait operations have been completed so far if the current value of semaphore is 6 ? (A) 1 (B) 5 (C) 7 (D) 11
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD