What are counting semaphores and resource semaphore?

1 Answer

If a task tries to take the semaphore when the integer is equal to zero, then the task will block. These semaphores are called counting semaphore.

Some system offer semaphore that can be released only by the task that took them. These semaphore are useful for the shared data problem, but they cannot be used to communicate between two tasks. Such semaphores are called resource semaphore.
Like 0 like


Answer : A semaphore is called binary semaphore when its value is 0, it is assumed that it has been taken (or accepted) & when its value is 1, it is assumed that it has been released & no ... that are not themselves reentrant.3. A reentrant function may does not use the hardware in a nonatomic way.

Description : There are three processes P1, P2 and P3 sharing a semaphore for synchronising a variable. Initial value of semaphore is one. Assume that negative value of semaphore tells us how many processes are waiting in queue. Processes access ... The final value of semaphore will be: (1) 0 (2) 1 (3) -1 (4) -2 

Answer : Answer: 1

Description : Suppose there are four processes in execution with 12 instances of a Resource R in a system. The maximum need of each process and current allocation are given below: With reference to current allocation, is system safe? If so, ... B) Yes, P1 P2 P3 P4 (C) Yes, P4 P3 P1 P2 (D) Yes, P2 P1 P3 P4

Answer : (C) Yes, P4 P3 P1 P2

Description : State the methods of task synchronization. Describe semaphore with suitable example.

Answer : The methods of task synchronization are: Semaphore Message queue. Mutual exclusion.  Dead lock. Mailboxes. Message Queues. Semaphores: It is a system of sending message by using flags. Multiple concurrent threads of execution ...   signal(Sem);  }  in process P2  {  wait(Sem);  S2;  }

Description : The most specific & sensitive method for assessment of compliance can be used to detect potent therapeutic agent in body fluids is a) Drug analysis. b) Interrogation. c) Urine marker. d) Residual Tablet counting.

Answer : a) Drug analysis. 

Ask a Question ← Prev Page Next Page →