JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech III CONCURRENT PROGRAMMING Previous Question Paper (August/September - 2021 - R18)

B.Tech | III | II | R18 | August/September - 2021

Answer PaperPaper Code: 156AMMaximum Marks: 75Time: 3 Hours

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

Write Lock one algorithm for two thread problem and give its disadvantages.

7 marks

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.

flag[i] = true; while (flag[j]); // Wait for other thread

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.

b

Examine lock two algorithm for two threads problem.

8 marks

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.

victim = i; while (victim == i); // Wait for 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.

215 marks
a

Explain Peterson Algorithm for achieving mutual exclusion.

7 marks

Answer

Sign in to view the complete answer paper.

b

Prove that Bakery algorithm is dead lock free.

8 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Develop lock based queue and explain.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write about linearliazability, compositional linearliazability and non blocking property.

8 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Compare and Contrast concurrent Vs Sequential object.

7 marks

Answer

Sign in to view the complete answer paper.

b

Analyze synchronized block and locks in Java.

8 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Discuss about wait free consensus protocol.

7 marks

Answer

Sign in to view the complete answer paper.

b

Elaborate compare set operation.

8 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Propose lock free universal algorithm.

7 marks

Answer

Sign in to view the complete answer paper.

b

Compare test-and-set (TAS), test-and-test-and-set (TTAS) operations.

8 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

Compare coarse grained Vs fine grained synchronization.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain how do you represent sets with linked list and illustrate with examples.

8 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Elaborate back off stack with example.

7 marks

Answer

Sign in to view the complete answer paper.

b

Construct unbounded lock free queue.

8 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of CONCURRENT PROGRAMMING from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for B.Tech CSE III II, August/September - 2021, R18.

For the solved question paper with answers, switch to the Answer Paper tab.

Other papers in CONCURRENT PROGRAMMING

Loading Question Papers

Fetching data from database...