We’ve seen one implementation of the process synchronization functions in Figure10.24. However,thereare several drawbacks to this particular implementation of these functions. Explain what they areand how you would ?x them

What will be an ideal response?

In no particular order,hereare the limitations: 1. The WAIT_PARENT and WAIT_CHILD functions call sigsuspend(2) with all signals unblocked. If the caller has blocked any signals beforecalling TELL_WAIT,these signals would no longer be blocked after waiting for the parent or child. The way to ?x this is to call sigsuspend but specify oldmaskinstead. 2. The WAIT_PARENT and WAIT_CHILD functions restorethe original signal mask that was in place when TELL_WAIT was called. This means that the WAIT_* functions can only be called one time. One way to solve this is to add a new function called TELLWAIT_DONE that restores the original signal mask. Then the TELL_* functions and the WAIT_* functions can be called multiple times beforecalling TELLWAIT_DONE.The only reason that the program shown in Figure 23 works is that the check_openfiles takes so long that the other process has time to go to sleep, so the signal doesn’t occur beforethe process goes to sleep. 3. Because the synchronization functions use SIGUSR1 and SIGUSR2, applications that use these functions can’t use these same signals at the same time. It would be better to allow the caller to select which signals to use. Beforethe inclusion of the real-time signals in the Single UNIX Speci?cation, therewereonly two user-de?ned signals. However,now thereare all the signals between SIGRTMIN and SIGRTMAX,inclusive, in addition to SIGUSR1andSIGUSR2

Computer Science & Information Technology

You might also like to view...

You can create a hyperlink in a presentation that launches your browser and connects to a Web page

Indicate whether the statement is true or false

Computer Science & Information Technology

The name of a variable in a variable declaration should come directly after its .

a) type b) value c) size d) All of the above.

Computer Science & Information Technology