[不是问题] C代码的紧急帮助 [英] [Not a question] urgent help for C code

查看:61
本文介绍了[不是问题] C代码的紧急帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从命令行接受读者数量。在任何情况下都不会使用超过10个读者,并且总是至少使用1个读者。每个读者必须在C.S中访问共享计数器值250000000次。读取器只读取一次,而写入器只写一次。每个读者在完成后都需要打印其名称。作者将更新值25000次并完成打印。当作者进入临界区并在离开临界区之前重置它时,编写者还将设置一个共享标志in-cs。读者必须在进入临界区时检查此标志并在设置标志时写入错误消息。

解决方案

这里我们回答成员在会议期间面临的具体问题编程。



我们无法处理整个源代码。你需要自己做。

如果你在编码时遇到任何困难,请随时回到这里并提出另一个问题来描述这个场景。



会员很乐意为您提供帮助。



Happy Coding。 :)

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.

解决方案

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. :)


这篇关于[不是问题] C代码的紧急帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆