Does the given solution satisfy the mutual exclusion requirement? Explain (a simple 'yes-no' answer is NOT enough. What is the mutual exclusion requirement? Why is (not?) sattisfied?)

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Modern Operating Systems must tackle the challenges of Synchronization and Deadlock. 'Process Synchronization' is the task of coordinating the execution of processes in a way that no two processes can have access to the same shared data or resource. A process requesting a resource may have to wait, if the resource is not available at that time. Sometimes, a waiting process is never able to change state, because the resources it has requested are held by other waiting processes; this situation is called 'Deadlock'.

In concurrent programming, a "critical section" is a part of a multi-process program that
may not be concurrently executed by more than one of the program's thread. Let us consider a 2 processes solution:

do {
flag[i] = TRUE;
while(flag[j]); %wait
CRITICAL SECTION
flag[i] = FALSE;
REMAINDER SECTION
} while (TRUE);
Pseudo-code of $P_i$ (the one of $P_j$ is symmetric)

a) Does the given solution satisfy the mutual exclusion requirement? Explain (a
simple 'yes-no' answer is NOT enough. What is the mutual exclusion requirement? Why is
(not?) sattisfied?)

b) Does the given solution sattisfy the progress requirement? Explain

c) Does the given solution have the risk of deadlock? Make a simulation to support
your answer (no point without a valid simluation)

d) If your answer to the previous question is positive (i.e. Yes, there is the risk of
deadlock), how can you modify the given solution to make it working?

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY