I think the type of "n" in ...

old (HH)
I think the type of "n" in your Thread1 should be unsigned or add some codes to limit its increasement (n++) in case it becomes negative,
and the shared memory should be synchronized. I am not very sure if it is no problem in practice of this specific implementation to access the shared memory without synchronization.
2001-6-3 -05:00

回到话题: Computer Jobs need true skills----see these assignments, please

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论