Prev | Current Page 284 | Next

Carl Reynolds and Paul Tymann

"Schaum's Outline of Principles of Computer Science"

The two operations defined for condition variables are usually called ???wait??™ and
signal (to reactivate).
For instance, suppose a consumer process using a monitor finds there is nothing to consume at this moment.
The monitor would provide a condition variable, perhaps called itemsReady, on which the process could wait.
When a process is waiting on a condition variable within the monitor, another process may enter. In fact,
if another process has been waiting for the monitor, as soon as the active process in the monitor waits for a
condition variable, the process that has been waiting will gain access to the monitor and become the monitor??™s
active process.
At some point, some cooperating process will change the condition on which another process has been
waiting. For instance, a producer process will create an item that the consumer can process. When a process
makes such a change, the active process will signal the condition variable. A signal will cause the monitor to
reactivate one of the processes waiting (there may be more than one process waiting) on that condition variable.
Signals are not counters, as semaphores are. If a signal occurs and no process is waiting on that condition
variable, nothing happens.


Pages:
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
poker online słownik teksty piosenek poker no limit imprezy integracyjne dla firm