Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Process Synchronization
Recent questions tagged process-synchronization
0
votes
0
answers
121
Galvin Edition 9 Exercise 5 Question 34 (Page No. 248)
Suppose we replace the $wait($) and $signal()$ operations of monitors with a single construct a $wait(B)$, where B is a general Boolean expression that causes the process executing it to wait until B becomes true. ... implemented efficiently. c. What restrictions need to be put on the await statement so that it can be implemented efficiently ?
Suppose we replace the $wait($) and $signal()$ operations of monitors with a single construct a $wait(B)$, where B is a general Boolean expression that causes the process...
akash.dinkar12
312
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
122
Galvin Edition 9 Exercise 5 Question 33 (Page No. 248)
When a signal is performed on a condition inside a monitor, the signaling process can either continue its execution or transfer control to the process that is signaled. How would the solution to the preceding exercise differ with these two different ways in which signaling can be performed?
When a signal is performed on a condition inside a monitor, the signaling process can either continue its execution or transfer control to the process that is signaled. H...
akash.dinkar12
467
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
123
Galvin Edition 9 Exercise 5 Question 32 (Page No. 248)
A file is to be shared among different processes, each of which has a unique number. The file can be accessed simultaneously by several processes, subject to the following constraint: the sum of all unique numbers associated with ... processes currently accessing the file must be less than $n$.Write a monitor to coordinate access to the file.
A file is to be shared among different processes, each of which has a unique number. The file can be accessed simultaneously by several processes, subject to the followin...
akash.dinkar12
990
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
124
Galvin Edition 9 Exercise 5 Question 31 (Page No. 248)
Consider a system consisting of processes $P_1, P_2, ..., P_n$, each of which has a unique priority number. Write a monitor that allocates three identical printers to these processes, using the priority numbers for deciding the order of allocation.
Consider a system consisting of processes $P_1, P_2, ..., P_n$, each of which has a unique priority number. Write a monitor that allocates three identical printers to the...
akash.dinkar12
412
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
125
Galvin Edition 9 Exercise 5 Question 29 (Page No. 248)
How does the $signal()$ operation associated with monitors differ from the corresponding operation defined for semaphores?
How does the $signal()$ operation associated with monitors differ from the corresponding operation defined for semaphores?
akash.dinkar12
186
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
126
Galvin Edition 9 Exercise 5 Question 28 (Page No. 247)
Discuss the tradeoff between fairness and throughput of operations in the readers–writers problem. Propose a method for solving the readers–writers problem without causing starvation.
Discuss the tradeoff between fairness and throughput of operations in the readers–writers problem. Propose a method for solving the readers–writers problem without ca...
akash.dinkar12
319
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
127
Galvin Edition 9 Exercise 5 Question 26 (Page No. 247)
Design an algorithm for a bounded-buffer monitor in which the buffers (portions) are embedded within the monitor itself.
Design an algorithm for a bounded-buffer monitor in which the buffers (portions) are embedded within the monitor itself.
akash.dinkar12
241
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
128
Galvin Edition 9 Exercise 5 Question 25 (Page No. 247)
Demonstrate that monitors and semaphores are equivalent in so far as they can be used to implement solutions to the same types of synchronization problems.
Demonstrate that monitors and semaphores are equivalent in so far as they can be used to implement solutions to the same types of synchronization problems.
akash.dinkar12
381
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
129
Galvin Edition 9 Exercise 5 Question 23 (Page No. 247)
Show how to implement the $wait()$ and $signal()$ semaphore operations in multiprocessor environments using the $test and set() $instruction. The solution should exhibit minimal busy waiting.
Show how to implement the $wait()$ and $signal()$ semaphore operations in multiprocessor environments using the $test and set() $instruction. The solution should exhibit ...
akash.dinkar12
190
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
130
Galvin Edition 9 Exercise 5 Question 22 (Page No. 247)
Windows Vista provides a lightweight synchronization tool called slim reader-writer locks. Whereas most implementations of reader-writer locks favor either readers or writers, or perhaps order waiting threads using a $FIFO$ policy, ... waiting threads ordered in a $FIFO$ queue. Explain the benefits of providing such a synchronization tool.
Windows Vista provides a lightweight synchronization tool called slim reader–writer locks. Whereas most implementations of reader–writer locks favor either readers or...
akash.dinkar12
522
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
131
Galvin Edition 9 Exercise 5 Question 21 (Page No. 247)
Servers can be designed to limit the number of open connections. For example, a server may wish to have only N socket connections at any point in time. As soon as N connections are made, the server will not accept ... existing connection is released. Explain how semaphores can be used by a server to limit the number of concurrent connections.
Servers can be designed to limit the number of open connections. For example, a server may wish to have only N socket connections at any point in time. As soon as N conne...
akash.dinkar12
2.0k
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
132
Galvin Edition 9 Exercise 5 Question 20 (Page No. 246-247)
Consider the code example for allocating and releasing processes shown below: ... of processes = 0 with the atomic integer atomic t number of processes = 0 to prevent the race condition(s)?
Consider the code example for allocating and releasing processes shown below:$#define MAX PROCESSES 255int number of processes = 0;/* the implementation of fork() calls t...
akash.dinkar12
2.0k
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
1
votes
0
answers
133
Galvin Edition 9 Exercise 5 Question 19 (Page No. 246)
A multithreaded web server wishes to keep track of the number of requests it services (known as hits). Consider the two following strategies to prevent a race condition on the variable hits. The first strategy is to use a basic ... Explain which of these two strategies is more efficient.
A multithreaded web server wishes to keep track of the number of requests it services (known as hits). Consider the two followingstrategies to prevent a race condition on...
akash.dinkar12
639
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
134
Galvin Edition 9 Exercise 5 Question 18 (Page No. 246)
Assume that a context switch takes T time. Suggest an upper bound (in terms of T) for holding a spinlock. If the spinlock is held for any longer, a mutex lock (where waiting threads are put to sleep) is a better alternative.
Assume that a context switch takes T time. Suggest an upper bound (in terms of T) for holding a spinlock. If the spinlock is held for any longer, a mutex lock (where wait...
akash.dinkar12
424
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
1
votes
0
answers
135
Galvin Edition 9 Exercise 5 Question 17 (Page No. 245)
Assume that a system has multiple processing cores. For each of the following scenarios, describe which is a better locking mechanism-a spinlock or a mutex lock where waiting processes sleep while waiting for the lock to become available: The ... lock is to be held for a long duration. A thread may be put to sleep while holding the lock.
Assume that a system has multiple processing cores. For each of the following scenarios, describe which is a better locking mechanism—a spinlock or a mutex lock where w...
akash.dinkar12
756
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
136
Galvin Edition 9 Exercise 5 Question 15 (Page No. 244)
Consider how to implement a mutex lock using an atomic hardware instruction. Assume that the following structure defining the mutex lock is available: typedef struct { int available; } lock; (available == 0) indicates that the lock is ... $ void release(lock *mutex)$ Be sure to include any initialization that may be necessary.
Consider how to implement a mutex lock using an atomic hardware instruction. Assume that the following structure defining the mutexlock is available:typedef struct {int a...
akash.dinkar12
554
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
137
Galvin Edition 9 Exercise 5 Question 14 (Page No. 244)
Describe how the compare_and_swap() instruction can be used to provide mutual exclusion that satisfies the bounded-waiting requirement.
Describe how the compare_and_swap() instruction can be used to provide mutual exclusion that satisfies the bounded-waiting requirement.
akash.dinkar12
266
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
138
Galvin Edition 9 Exercise 5 Question 13 (Page No. 244)
Describe two kernel data structures in which race conditions are possible.Be sure to include a description of how a race condition can occur.
Describe two kernel data structures in which race conditions are possible.Be sure to include a description of how a race condition can occur.
akash.dinkar12
585
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
139
Galvin Edition 9 Exercise 5 Question 12 (Page No. 244)
The Linux kernel has a policy that a process cannot hold a spin lock while attempting to acquire a semaphore. Explain why this policy is in place.
The Linux kernel has a policy that a process cannot hold a spin lock while attempting to acquire a semaphore. Explain why this policy is in place.
akash.dinkar12
357
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
140
Galvin Edition 9 Exercise 5 Question 11 (Page No. 244)
Explain why interrupts are not appropriate for implementing synchronization primitives in multiprocessor systems.
Explain why interrupts are not appropriate for implementing synchronization primitives in multiprocessor systems.
akash.dinkar12
244
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
141
Galvin Edition 9 Exercise 5 Question 10 (Page No. 243)
Explain why implementing synchronization primitives by disabling interrupts is not appropriate in a single-processor system if the synchronization primitives are to be used in user-level programs.
Explain why implementing synchronization primitives by disabling interrupts is not appropriate in a single-processor system if the synchronization primitives are to be us...
akash.dinkar12
506
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
1
votes
1
answer
142
Galvin Edition 9 Exercise 5 Question 9 (Page No. 243-245)
The first known correct software solution to the critical-section problem for n processes with a lower bound on waiting of n − 1 turns was presented by Eisenberg and McGuire. The processes share the following variables: enum pstate ${idle, want in, in cs}$; ...
The first known correct software solution to the critical-section problem for n processes with a lower bound on waiting of n − 1 turns was presented by Eisenberg and Mc...
akash.dinkar12
2.0k
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
143
Galvin Edition 9 Exercise 5 Question 8 (Page No. 243-244)
The first known correct software solution to the critical-section problem for two processes was developed by Dekker. The two processes, P0 and P1, share the following variables: boolean $flag[2]$; /* initially false */ int turn; The structure of ... * critical section */ turn = j; $flag[i]$ = false; /* remainder section */ } while (true);
The first known correct software solution to the critical-section problem for two processes was developed by Dekker. The two processes, P0 and P1, share the following var...
akash.dinkar12
379
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
144
Galvin Edition 9 Exercise 5 Question 7 (Page No. 243)
Race conditions are possible in many computer systems. Consider a banking system that maintains an account balance with two functions: $deposit(amount)$ and $withdraw(amount)$. These two functions are passed the amount that is to ... . Describe how a race condition is possible and what might be done to prevent the race condition from occurring.
Race conditions are possible in many computer systems. Consider a banking system that maintains an account balance with two functions: $deposit(amount)$ and $withdraw(amo...
akash.dinkar12
715
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
1
answer
145
Galvin Edition 9 Exercise 5 Question 6 (Page No. 243)
Illustrate how a binary semaphore can be used to implement mutual exclusion among n processes.
Illustrate how a binary semaphore can be used to implement mutual exclusion among n processes.
akash.dinkar12
3.2k
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
146
Galvin Edition 9 Exercise 5 Question 5 (Page No. 243)
Show that, if the $wait()$ and $signal()$ semaphore operations are not executed atomically, then mutual exclusion may be violated.
Show that, if the $wait()$ and $signal()$ semaphore operations are not executed atomically, then mutual exclusion may be violated.
akash.dinkar12
145
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
147
Galvin Edition 9 Exercise 5 Question 4 (Page No. 243)
Explain why spin locks are not appropriate for single-processor systems yet are often used in multiprocessor systems.
Explain why spin locks are not appropriate for single-processor systems yet are often used in multiprocessor systems.
akash.dinkar12
147
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
148
Galvin Edition 9 Exercise 5 Question 3 (Page No. 243)
What is the meaning of the term busy waiting ? What other kinds of waiting are there in an operating system ? Can busy waiting be avoided altogether ? Explain your answer.
What is the meaning of the term busy waiting ? What other kinds of waiting are there in an operating system ? Can busy waiting be avoided altogether ? Explain your answer...
akash.dinkar12
162
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
149
Galvin Edition 9 Exercise 5 Question 2 (Page No. 242)
Explain why Windows, Linux, and Solaris implement multiple locking mechanisms. Describe the circumstances under which they use spin locks,mutex locks, semaphores, adaptive mutex locks, and condition variables. In each case, explain why the mechanism is needed.
Explain why Windows, Linux, and Solaris implement multiple locking mechanisms. Describe the circumstances under which they use spin locks,mutex locks, semaphores, adaptiv...
akash.dinkar12
553
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
0
votes
0
answers
150
Galvin Edition 9 Exercise 5 Question 1 (Page No. 242)
disabling interrupts frequently can affect the system’s clock. Explain why this can occur and how such effects can be minimized.
disabling interrupts frequently can affect the system’s clock. Explain why this can occur and how such effects can be minimized.
akash.dinkar12
197
views
akash.dinkar12
asked
Mar 20, 2019
Operating System
galvin
operating-system
process-synchronization
descriptive
+
–
Page:
« prev
1
2
3
4
5
6
7
8
9
10
...
16
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register