Specifications


Designing and implementing new system calls for Readers-writers semaphores (we will call them rw-sems) and demonstrate their working through a program involving reader and writer processes.

Semantics of Readers--writers semaphores are modelled after the readers-writers problem. Processes that make system calls r_wait or w_wait should be blocked and activated as per these semantics.
 

Details

 
  • rw_sem_use_begin : Takes a character string to be used as the name of rw-sem. If the semaphore does not already exist, it is created and initialized.
  • r_wait : Takes the name of a rw-sem as a parameter. It either blocks the process making the call or permits it to continue its operation as per semantics of rw-sems.
  • w_wait : Takes the name of a rw-sem as a parameter. It either blocks the process making the call or permits it to continue its operation as per semantics of rw-sems.
  • rw_signal : Activates one or more processes, if appropriate as per semantics of rw-sems.
  • rw_sem_use_end : Takes the name of a rw-sem as parameter. It destroys the semaphore if it is not in use by any other process.

Report

 

Download