Created by
Terms in this set (38)
It could interleave if the blue code starts running, but then that process running that code gets taken off the CPU by the CPU scheduler, and then the process running the gold code is put onto the CPU by the CPU scheduler. It could also happen in a multiprocessor system if the blue code is on one processor and the gold code is on another processor. In either case, the final result for counter could be incorrect. Treating the code as a critical section would have avoided this problem

Any solution to the critical-section problem must satisfy the progress condition, which says: If no process is executing in its critical section and there exist some processes that wish to enter their critical section, then the selection of the processes that will enter the critical section next cannot be postponed indefinitely. What does that mean?
Consider the synchronization Algorithm 1 shown in class. The code for one process, p1,is shown at the right; the code for the other process, p2, is similar.
a). Does this algorithm enforce mutual exclusion? Explain.
b). Does this algorithm avoid dead lock? Explain
c). What is the primary deficiency with this algorithm?
a). Does this algorithm enforce mutual exclusion? Explain.
b). Does this algorithm avoid dead lock? Explain
c). What is the primary deficiency with this algorithm?
a). Yes, a process can only enter the critical section at a time - if it is turn.
b). Yes, since they take turns one process should always be able to enter the critical section
c). It forces the processes to take turns in a strict alternation, so if one process wants to enter the critical section more frequently than the other, it cannot. Finally, it wastes time busy waiting
b). Yes, since they take turns one process should always be able to enter the critical section
c). It forces the processes to take turns in a strict alternation, so if one process wants to enter the critical section more frequently than the other, it cannot. Finally, it wastes time busy waiting

Sets found in the same folder
Other sets by this creator
Verified questions
Recommended textbook solutions

Information Technology Project Management: Providing Measurable Organizational Value
5th Edition•ISBN: 9781118898208Jack T. Marchewka346 solutions

Introduction to Algorithms
3rd Edition•ISBN: 9780262033848 (4 more)Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen726 solutions

Service Management: Operations, Strategy, and Information Technology
7th Edition•ISBN: 9780077475864James Fitzsimmons, Mona Fitzsimmons103 solutions

Information Technology Project Management: Providing Measurable Organizational Value
5th Edition•ISBN: 9781118911013 (1 more)Jack T. Marchewka346 solutions
Other Quizlet sets
1/5