04 - Inter-Process Communication Flashcards
Within the scope of Inter-Process Communication (IPC), what are the characteristics of a system?
Composed of
- Functions / Modules - Classes - Processes
Processes can be running in different/same space and at different/same time.
Explain the offers and considerations within an Operating System Infrastructure.
Operating Systems offer
- Execution mechanisms
- Protection mechanisms
- Communication mechanisms
Protection is achieved since processes are independent entities where one process execution does not affect other processes, and the memory is private.
However, processes in the same system need to exchange information or data to divide tasks, increase processing power or guarantee synchronization and consistency among them.
What are the different types of IPC facilities? What are they concerned with?
- Communication
- Concerned with exchanging data between processes
- Synchronization
- Concerned with synchronizing the actions of processes or threads
- Signals
- Concerned with event notifications
- Synchronization technique in certain circumstances
- Rarely a communication technique since a signal number itself is information
Name different types of IPC facilities of the different types.
- Communication
- Data transfer
- Byte stream
- Pipe
- FIFO
- Stream socket
- Pseudo-terminal
- Message
- System V message queue
- POSIX message queue
- Datagram socket
- Byte stream
- Shared memory
- System V shared memory
- POSIX shared memory
- Memory mapping
- Anonymous mapping
- Mapped file
- Data transfer
- Synchronization
- Semaphore
- System V
- POSIX
- Named
- Unnamed
- File lock
- “Record” lock (fcntl())
- File lock (flock())
- Mutex (threads)
- Condition variables (threads)
- Semaphore
- Signals
- Standard signal
- Real-time signal
Explain the concept of explicit/implicit communication and give examples.
Explicit communication
- Required the definition of the message payload
- Invocation of a send method
- Invocation of a receive method
- Example: FIFO
Implicit communication
- Does not require a definition
- Example: shared memory
Explain the method of implementation of an IPC.
The transmission of information may require the participation of the Kernel.
Kernel implement IPC
- Process call a system call
- Kernel redirects information to the suitable process
- Requires data copy
- Example: pipes, FIFOs, sockets
Direct implementation
- Shared memory
Define the concept of scope in IPC.
The scope is the location of the entities that communicate.
- In the same process
- In the same machine
- In the network
Local
- Share memory (inside a process)
- Shared memory (multiple processes)
- Pipes
Remote/Distributed
- Sockets
- Shared memory
What is process relation in IPC?
It is the relationship of the processes that can communicate.
- Parent-child
- Siblings
- Any process
- Pipes: father/sons/brother
- FIFOs, named pipes, sockets: unrelated processes
What are some examples of functionalities and IPC uses?
Byte-steam: pipes, sockets
Notifications: message queues
Messages: sockets
Broadcast: sockets
What are the types of duplex communication?
- Half-duplex - one-way communication - Pipes
- Duplex - two-way communication - sockets
- None - shared memory
How is identification handled in the OS?
Channels can be identified by
- Path name/file in the file-systems - FIFOsm shared memory
- Network address
- Key - message queues
- None - pipes
What are the types of accessibility to the channel in IPC?
- Related processes - pipes, shared memory
- Permission mask / FS permissions - FIFO, message queues
- None - sockets
How are channels identified inside apps?
- File descriptors
- Numeric identifiers - message queues (other type)
- Pointers - message queues
What is the concept of persistence in IPC?
Controls the lifetime of an IPC object
- Process-persistent IPC object remains in existence only as long as it is held open by at least one process - pipe, FIFO, sockets
- Kernel-persistent IPC object exists until either it is explicitly deleted or the system is shut down - message queues
- File-system persistence IPC object retains its information even when the system is rebooted - memory-mapped files
What are the types of blocking, and where can they be used?
Access blocking
- With no other participant - FIFO
- With no data - synchronization - socket, FIFO, message queues
- Unblocking - sockets, FIFOs