Unit 2 2
Unit 2 2
PROCESS MANAGEMENT
Syllabus
• Shared data
#define BUFFER_SIZE 10
typedef struct {
. . .
} item;
item buffer[BUFFER_SIZE];
int in = 0;
int out = 0;
message next_produced;
while (true) {
/* produce an item in next produced */
send(next_produced);
message next_consumed;
while (true) {
receive(next_consumed);
• Sockets
• Remote Procedure Calls
• Pipes
• Remote Method Invocation (Java)
Sockets
• A socket is defined as an endpoint for communication
• Concatenation of IP address and port – a number included
at start of message packet to differentiate network
services on a host
• The socket 161.25.19.8:1625 refers to port 1625 on host
161.25.19.8
• Communication consists between a pair of sockets
• All ports below 1024 are well known, used for standard
services
• Special IP address 127.0.0.1 (loopback) to refer to system
on which process is running
Socket Communication
Sockets in Java
• Three types of sockets
• Connection-oriented
(TCP)
• Connectionless (UDP)
• MulticastSocket
class– data can be
sent to multiple
recipients