Process Concept Process Scheduling Operations On Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems
Process Concept Process Scheduling Operations On Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems
Process Concept Process Scheduling Operations On Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems
Process Concept
Process Scheduling
Operations on Processes
Cooperating Processes
Interprocess Communication
Communication in Client-Server Systems
Address space
Child duplicate of parent.
Child has a program loaded into it.
UNIX examples
fork system call creates new process
exec system call used after a fork to replace the
process’ memory space with a new program.
item nextProduced;
while (1) {
while (((in + 1) % BUFFER_SIZE) == out)
; /* do nothing */
buffer[in] = nextProduced;
in = (in + 1) % BUFFER_SIZE;
}
item nextConsumed;
while (1) {
while (in == out)
; /* do nothing */
nextConsumed = buffer[out];
out = (out + 1) % BUFFER_SIZE;
}
Operations
create a new mailbox
send and receive messages through mailbox
destroy a mailbox
Primitives are defined as:
send(A, message) – send a message to mailbox
A
receive(A, message) – receive a message from
mailbox A
Mailbox sharing
P1, P2, and P3 share mailbox A.
P1, sends; P2 and P3 receive.
Who gets the message?
Solutions
Allow a link to be associated with at most two
processes.
Allow only one process at a time to execute a
receive operation.
Allow the system to select arbitrarily the
receiver. Sender is notified who the receiver
was.
Sockets
Remote Procedure Calls
Remote Method Invocation (Java)