13. 14. Interprocess Communication Flashcards
Synchronisation and Blocking Primitives Socket Level Client Server Systems
In the most basic form of IPC, each process acts as….
Sender or receiver or both
What is the most important facility that the OS provides for IPC? What does it rely on the OS for?
An Application Programming Interface (API) for IPC.
Two important services it relies on the OS for are:
Providing synchronisation Mechanisms
Keeping network buffers
What API operations do processes call to communicate?
Connect- sender process calls this to initiate the engagement
Accept- receiver process calls to specifier its readiness
Disconnect- either process use this to disengage
Send- sender process calls this passing as arguments the receiver and the data
Receive- Receiver process calls this passing as arguments the location where data is to be placed (and maybe the sender)
What signals does the OS Kernel respond to calls with?
S_C- Asynchronous send complete R_C- asynchronous receive complete wa- wait for asynchronous send ws- wait for synchronous send wr- wait for receive (p,s_c)- wait, synchronous send complete (p,r_c)- wait, synchronous receive complete
What happens when a process wants to communicate with another process?
Call API operations in a predetermined order.
What happens upon an operation call?
An interaction event occurs
Send- causes the event where the data is transmitted to the other process
receive- causes the event where upon the receipt of data the received data is placed in the specified location
What types of send operations are there?
Blocking Send- sender is blocked until message is received.
Non-blocking Send- messages are queued in an unbounded message buffer, sender never blocked.
Buffer-blocking Send- messages are queued in a bounded message buffer and sender is only blocked if buffer is full.
Blocking signals come from the OS kernel
What are the types are receive operations?
Blocking receive- receiver is blocked until a message is available
Non-blocking receive- the receiver is never blocked
Blocking signals come from the OS kernel
What is Synchronous message passing?
The send and receive operations are both blocking.
Whichever executes its operation first will be blocked
What is asynchronous message passing?
blocking receiver operations are user either with non-blocking or buffer-blocking send
Basic API for IPC- what signals does the OS kernel respond to calls with
Asynronous send complete s_c- respond to sender with this when the request to send has been completed. (data en route)
Asynchronous receive complete r_c- responds to the receiver process with this then the request to receive has been carried out (data available)
Synchronous versions of these signals (p,s_c) and (p-r_c) are paired up with others such as wa, ws, wr
What are the three timelines for each communicating process?
a) application process’ thread of control
b) the copying to/from buffers in OS user or kernel space
c) for the OS kernel
What are the two basic ways for a DS to share information?
Share State
Exchange Messages
How was the second lab a shared-state system?
The PHP server acted as a blackboard. One of the clients polled to see if there was anything new written
How was the third lab a message-passing system?
We wrote both client and server. Clients send messages to server, server sends them to the clients