JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech III CONCURRENT PROGRAMMING Previous Question Paper (August/September - 2021 - R18)
Answer any five questions. All questions carry equal marks.
Main
Write Lock one algorithm for two thread problem and give its disadvantages.
Answer
The Lock One algorithm uses a flag array to indicate the intent of each thread to enter the critical section. Each thread sets its corresponding flag to true and then waits for the other thread's flag to become false before entering.
The primary disadvantage of Lock One is that it is susceptible to deadlock. If both threads set their respective flags to true simultaneously before either thread checks the other's flag, both threads will enter an infinite loop waiting for the other to set its flag to false, resulting in a system hang.
Examine lock two algorithm for two threads problem.
Answer
The Lock Two algorithm attempts to solve the mutual exclusion problem by having each thread express its desire to enter the critical section by setting a variable to its own thread ID. The thread then waits until the variable holds the ID of the other thread.
In this algorithm, each thread declares itself the 'victim' of the other thread's potential entry. A thread can only enter the critical section if the variable 'victim' is not equal to its own ID. While this algorithm satisfies the mutual exclusion property, it is also flawed. If both threads set the 'victim' variable simultaneously, the last thread to write to the variable will overwrite the previous one. If a thread sets its ID and then immediately attempts to enter, it may find that the other thread has not yet set the variable, potentially leading to a race condition or a deadlock scenario depending on the timing of the execution.
Explain Peterson Algorithm for achieving mutual exclusion.
Answer
Sign in to view the complete answer paper.
Prove that Bakery algorithm is dead lock free.
Answer
Sign in to view the complete answer paper.
Develop lock based queue and explain.
Answer
Sign in to view the complete answer paper.
Write about linearliazability, compositional linearliazability and non blocking property.
Answer
Sign in to view the complete answer paper.
Compare and Contrast concurrent Vs Sequential object.
Answer
Sign in to view the complete answer paper.
Analyze synchronized block and locks in Java.
Answer
Sign in to view the complete answer paper.
Discuss about wait free consensus protocol.
Answer
Sign in to view the complete answer paper.
Elaborate compare set operation.
Answer
Sign in to view the complete answer paper.
Propose lock free universal algorithm.
Answer
Sign in to view the complete answer paper.
Compare test-and-set (TAS), test-and-test-and-set (TTAS) operations.
Answer
Sign in to view the complete answer paper.
Compare coarse grained Vs fine grained synchronization.
Answer
Sign in to view the complete answer paper.
Explain how do you represent sets with linked list and illustrate with examples.
Answer
Sign in to view the complete answer paper.
Elaborate back off stack with example.
Answer
Sign in to view the complete answer paper.
Construct unbounded lock free queue.
Answer
Sign in to view the complete answer paper.