answersLogoWhite

0


Best Answer

yes

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Is semaphore synchronize critical resources to prevent deadlock?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is mutually exclusive?

It is one of thecharacteristics of deadlock. When semaphores are used or mutual exclusion, the semaphore has an initial value of 1, and P() is called before the critical section, and V() is called after the critical section as shown below : semaphore-> P(); critical section semaphore-> V(); remainder section let us suppose that one process A is already executing its critical section then it implies that semaphore value at that time is zero. If process B now tries to enter this critical section , it cannot enter the critical section because it will have to wait before semaphore becomes greater than zero. This is possible only when process A executes its signal operation; after executing its critical section.


Advantages and disadvantages of semaphore in os?

Advantage of semaphore is simplicity. Disadvantage of semaphore is more prone to programmer error. It does not guarantee that if programmer misplace the P and V then it will also work correctly. It may occur deadlock or violation of mutual exclusion due to programmer error.


What is an application thread deadlock?

A deadlock usually occurs when there are multiple threads running. Let us say there are 3 threads A, B and C running.A is holding resources X and is currently for the resource Y to complete the operation. B is holding resources Y and is waiting for resource Z to complete. C is holding Z and is waiting for X to complete. This is called a deadlock, All the 3 threads are waiting on some resources that are being held by other waiting threads. This causes an indefinite waiting which is termed as a Deadlock


What is deadlock and explain it?

A deadlock is when both sides can't agree on a decision or when something is stuck and can't move. In technology, a deadlock is a situation where a group of processes are permanently blocked as a result of each process having acquired a subset of the resources needed for its completion and waiting for release of the remaining resources held by others in the same group-thus making it impossible for any of the process to proceed.


Can deadlock be resolved without selecting a victim?

Yes, deadlock can be resolved by avoiding the conditions that lead to it, breaking the circular wait, or using deadlock prevention techniques like resource allocation graph, timeouts, or priority-based techniques. In some cases, deadlock can also be prevented by ensuring a single thread holds all resources simultaneously or by using a deadlock detection algorithm to preemptively handle it.


What is the difference among deadlock avoidance detection and prevention?

Deadlock avoidance involves ensuring that the system never enters a deadlock state by using techniques like resource allocation strategies (e.g., Banker's algorithm) to ensure that resources are allocated in a way that avoids deadlock. Deadlock detection, on the other hand, involves periodically checking the system to see if a deadlock has occurred after it has happened. Deadlock prevention focuses on designing algorithms and protocols in a way that eliminates one of the conditions necessary for deadlock to occur, such as by ensuring that resources are requested in a specific order.


What is difference between starvation and deadlock in os?

DEADLOCK:1) Deadlock process is permanently blocked because the required resource never becomes available.2) The resource under contention is not in continuous use.STARVATION:1) In starvation, it is not certain that a process will ever get the requested resources.2) the resource under contention is in continuous use.


What are the various strategies are used to handle deadlock and what is centralized and distributed deadlock detection and prevention?

There are four strategies of dealing with deadlock problem:1. The Ostrich ApproachJust ignore the deadlock problem altogether.2. Deadlock Detection and RecoveryDetect deadlock and, when it occurs, take steps to recover.3. Deadlock AvoidanceAvoid deadlock by careful resource scheduling.4. Deadlock PreventionPrevent deadlock by resource scheduling so as to negate at least one of the four conditions.


What are the differences between deadlock avoidance and deadlock prevention in operating systems?

Deadlock Prevention: o Preventing deadlocks by constraining how requests for resources can be made in the system and how they are handled (system design). o The goal is to ensure that at least one of the necessary conditions for deadlock can never hold. * Deadlock Avoidance: o The system dynamically considers every request and decides whether it is safe to grant it at this point, o The system requires additional apriori information regarding the overall potential use of each resource for each process. o Allows more concurrency. Similar to the difference between a traffic light and a police officer directing traffic. * Deadlock deduction:- Often, neither avoidance nor deadlock prevention may be used. Instead deadlock detection and process restart are used by employing an algorithm that tracks resource allocation and process states, and rolls back and restarts one or more of the processes in order to remove the deadlock. Detecting a deadlock that has already occurred is easily possible since the resources that each process has locked and/or currently requested are known to the resource scheduler or OS. Detecting the possibility of a deadlock before it occurs is much more difficult and is, in fact, generally undecidable, because the halting problem can be rephrased as a deadlock scenario. However, in specific environments, using specific means of locking resources, deadlock detection may be decidable. In the general case, it is not possible to distinguish between algorithms that are merely waiting for a very unlikely set of circumstances to occur and algorithms that will never finish because of deadlock. Deadlock detection techniques include, but is not limited to, Model checking. This approach constructs a Finite State-model on which it performs a progress analysis and finds all possible terminal sets in the model. These then each represent a deadlock.


Short note on fragmentation?

Starvation is similar in effect to http://www.answers.com/topic/deadlock-game. Deadlock occurs when two programs each hold resources the other needs to finish, and neither is willing to give them up. Starvation occurs when one program holds resources the other needs, but is unwilling to give them up.


What is deadlock in rdbms?

Deadlock in a relational database management system (RDBMS) occurs when two or more transactions are unable to proceed because each is waiting for resources that the other transaction holds. This creates a deadlock situation where transactions are effectively stuck and unable to complete. Deadlocks can lead to system performance degradation and require intervention to resolve them.


What is an antonym for the word deadlock?

The antonym for deadlock is agreement.