Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
accept the number of readers from the command line. In no case will more than 10 readers be used and always at least 1 reader will be used. Each reader must access a shared counter value 250000000 times in the C.S. A reader reads just one time and a writer writes just one time. Each reader needs to print its name when done. The writer will update the value 25000 times and print done. The writer will also set a shared flag, in-cs, when it enters the critical section and reset it just before it leaves the critical section. The reader must, upon entering the critical section, check this flag and write an error message if the flag is set.
Posted
Updated 23-Feb-14 19:39pm
v3
Comments
Sergey Alexandrovich Kryukov 24-Feb-14 1:36am    
I edit the tags to this post to explain what it is, not a question, and so on.
But I wonder, do you understand that it is also just rude? And useless?
—SA
Stefan_Lang 24-Feb-14 7:29am    
Tags "noturgent" and "Iamlazy"? I need to expand my filters :D

1 solution

Here we answer specific questions which members face during programming.

We can't work on the whole source code. You need to do that yourself.
If you face any difficulty while coding, feel free to come back here and ask another question with specific issue describing the scenario.

Members will be happy to help you then.

Happy Coding. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900