Professional Documents
Culture Documents
0 1
Deamon process should wait for a request message from a client process so perform semop(-1,0)
which is not possible so server will enter into waiting state.
Client willing to send a message will perform an operation semop(0,-1) so semaphore values are
changed to 0,0.
0 0
Client got access to shared memory and write a message into it and next major activity is to unblock
server process so client changes the semaphore values accordingly semop(1,0) and client also
specifies that there is a request
1 0
message in the shared memory by updating the first semaphore value as 1. and client needs to enter
into waiting state which is accomplished by an semop(-1,0) so perform semop(-1,-1)
Server will get unblocked with this values and semaphore values will be changed to
0,0.
0 0
Server will read the request and generate a response and will send the response into
the shared memory and perform an operation semop(1,1) which is responsible for
doing two things it unblocks the client and it also responsible for releasing the shared
1 1
memory completely from server.
Server needs to enter into waiting state so it performs the operation semop(-1,0)
Now client is unblocked by changing the semaphore values as 0,0
0 0
Client will read the response and reset the semaphore values as 0,1 by performing an
operation semop(0,1)