Can the flockfile and funlockfile functions introduced in Section 12.5 be used to solve the race found in the program from Figure8.12? Explain.

What will be an ideal response?

No, they can’t help with this race, because they can only be used to synchronize threads within a single address space. In Figure8.12, the two racing contexts areprocesses, not threads, and each process has its own address space, even though the child starts out as a copy of the parent. This means that when the child’s stream is locked, it doesn’t affect the parent’s copy of the stream.

Computer Science & Information Technology

You might also like to view...

?When setting the transition timing, it must be ensured that the speed of the transition is constant.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

_____ is an open-source operating system whose source code is freely available to everyone.

A. Linux B. Mac OS X C. Chrome D. Unix

Computer Science & Information Technology