04 - Inter-Process Communication Flashcards

1
Q

Within the scope of Inter-Process Communication (IPC), what are the characteristics of a system?

A

Composed of

- Functions / Modules

- Classes

- Processes

Processes can be running in different/same space and at different/same time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain the offers and considerations within an Operating System Infrastructure.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the different types of IPC facilities? What are they concerned with?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Name different types of IPC facilities of the different types.

A
  • Communication
    • Data transfer
      • Byte stream
        • Pipe
        • FIFO
        • Stream socket
      • Pseudo-terminal
      • Message
        • System V message queue
        • POSIX message queue
        • Datagram socket
    • Shared memory
      • System V shared memory
      • POSIX shared memory
      • Memory mapping
        • Anonymous mapping
        • Mapped file
  • Synchronization
    • Semaphore
      • System V
      • POSIX
        • Named
        • Unnamed
    • File lock
      • “Record” lock (fcntl())
      • File lock (flock())
    • Mutex (threads)
    • Condition variables (threads)
  • Signals
    • Standard signal
    • Real-time signal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain the concept of explicit/implicit communication and give examples.

A

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain the method of implementation of an IPC.

A

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Define the concept of scope in IPC.

A

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is process relation in IPC?

A

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are some examples of functionalities and IPC uses?

A

Byte-steam: pipes, sockets

Notifications: message queues

Messages: sockets

Broadcast: sockets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the types of duplex communication?

A
  • Half-duplex - one-way communication - Pipes
  • Duplex - two-way communication - sockets
  • None - shared memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How is identification handled in the OS?

A

Channels can be identified by

  • Path name/file in the file-systems - FIFOsm shared memory
  • Network address
  • Key - message queues
  • None - pipes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the types of accessibility to the channel in IPC?

A
  • Related processes - pipes, shared memory
  • Permission mask / FS permissions - FIFO, message queues
  • None - sockets
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How are channels identified inside apps?

A
  • File descriptors
  • Numeric identifiers - message queues (other type)
  • Pointers - message queues
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the concept of persistence in IPC?

A

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the types of blocking, and where can they be used?

A

Access blocking

  • With no other participant - FIFO
  • With no data - synchronization - socket, FIFO, message queues
  • Unblocking - sockets, FIFOs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Explain time coupling/uncoupling and where each is used.

A

Time coupling - the sender and receiver must exist at the same time. Uncoupling is the opposite. Related to persistence and blocking.

Time coupling - pipe, FIFO, sockets

Time uncoupling - file system, memory mapped files, message queues

17
Q

Explain the types of privacy in IPC.

A
  • Public communication
    • Any process can participate in the communication, even after establishing
    • Any process can receive messages
  • Private communication
    • After establishing communication. Nobody else can participate
    • Sockets
18
Q

Explain the concept of space coupling/endpoint identifications.

A

The participants know the identity of others. The receiver knows who the sender is and vice-versa.

Only sockets offer this. In other mechanisms, there is no way to identify who is accessing messages.

19
Q

How is reliability addressed in IPC?

A

Messages are delivered, and messages are correct.

20
Q

How is ordering addressed in sockets and shared memory?

A

In sockets, messages are received in the same order as sent.

In shared memory, there is no ordering.

21
Q

What is offered by the API?

A
  • Channel creation
  • Specific functions
  • Reuse of other APIS