C
codefuns
If C++ standard support multithread, 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.
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.