Assignment 12, due Aug 1
Part of
the homework for 22C:50, Summer 2003
|
a) How does this use Unix's parallel programming facilities to fake up a return from a program successfully launched by the execve() system call?
b) Where is the caller's state saved during the execution of the program that was launched by the execve() system call?
shared queue: semaphore Qdata, Qspace, Qmutex conventional queue Q shared queue initialize( self, size ) self.Qdata = 0 self.Qspace = size self.Qmutex = 1 conventional queue initialize( self.Q, size ) shared queue enqueue( self, item ) wait( self.Qspace ) wait( self.Qmutex ) conventional queue enqueue( self.Q, item ) signal( self.Qmutex ) signal( self.Qdata ) shared queue dequeue( self ) wait( self.Qdata ) wait( self.Qmutex ) item = conventional queue dequeue( self.Q ) signal( self.Qmutex ) signal( self.Qdata ) return item
Look back into the code for the asynch I/O driver given in Figure 10.8 of the notes. Focus on the output queue. routine. This is in some ways similar to a shared queue as given above, but it doesn't use semaphores.
a) How does the interrupt service routine signal that there is space in the queue?
b) How does the write routine signal that there is data in the queue?