codefuns wrote:[color=blue]
> If C++ standard support multithread,[/color]
It doesn't.
[color=blue]
> how can it implements writers and
> readers problem?
> the requirements is:
> 1.there are more than one writers and more than one readers
> 2.only one writer can write to a memory block at a time, when it
> writes, no other readers can read this memory block.
> 3.all the readers can read the memory block at the same time.
> 4.when there is a writer want to write data to the memory block, other
> readers that want to read the memory block after that time should be
> blocked and be waked when there is no writers write data to the memory
> block.
>
> what Synchronization technic should I use? seems mutex and semaphore
> all don't work for this requirement.
>
> I am a newbie, thanks for all your helps.[/color]
Boost (which is non-standard, but widely used) has a threading library
which uses the platform specific features of your platform (Windows and
Posix, maybe others) and provides tools for threaded programming, to
solve these problems.
http://www.boost.org/doc/html/threads.html
Ben Pope
--
I'm not just a number. To many, I'm known as a string...