in reply to Threads sharing global variable
Regarding the motivation of this exercise. Although I am not the original poster, I see there's a need to provide some further background.
The readers-writers problem is an elementary problem in concurrency, and the typical solution involves the use of condition variables. The construct has its origins in 1974/1975 when Hoarse and Hansen formulated the idea of monitors.
The Art of Multiprocessor Programming introduces this problem in Chapter 1. Their example has Alice and Bob place sentences on a billboard one letter at a time.
"Both the mutual exclusion and producer-consumer protocols require waiting: if one participant is subjected to an unexpected delay, so is the other. ... Surprisingly, the readers-writers problem does have solutions that do not require waiting.
The scope of this exercise is no doubt to provide a working demonstration based on the method of condition variables. Again, the wikipedia article should prove informative.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Threads sharing global variable
by BrowserUk (Patriarch) on Mar 10, 2016 at 23:42 UTC | |
|
Re^2: Threads sharing global variable
by Anonymous Monk on Mar 11, 2016 at 14:18 UTC |