It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
Lin545: A is a writer and writes a poem.
B is a reader and reads what Writer writes.

Reader must always be able to read the poem.
Hereby the poem must always be available.

When Reader begins to read the poem, the Writer must always wait.
However, most of the time - Writer will write and Reader will wait.

The problem: how to make sure Reader has poem to read.
Solution: Reader should inform Writer of his progress.

The problem: how to make sure Writer waits, when Reader reads his poem.
Solution: Writer must be able to see that Reader takes his poem from the shelf.
That was a very... peculiar way to describe the problem :)
Something like this:
http://stackoverflow.com/questions/811641/windows-threading-wait-method