On my understanding of this matter, the reason for “safety” in this specific example could not be that there are only one reader and one writer. The reason could be that the statement which access “status”,

old (HH)
e.g. “status=0;” or “status=1;”, is usually, if not always, compiled into a machine code instruction which is “atomic” when the machine's bits >= 8 * sizeof(int).

2001-6-23 -04:00

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

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