• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/21

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

21 Cards in this Set

  • Front
  • Back

What is Inter-Process Communication?

OS-supported mechanisms for interaction among processes (coordination & communication)

What are some types of IPC?

1. Message based - Passing messages across sockets, pipes, etc.


2. Memroy based - Shared memory, memory mapped files, etc.

Describe message-based IPC

1. Supports sending and receiving of messages


2. OS creates and maintains a channel (buffer, FIFO queue, etc).


3. OS provides an interface to the processes - a port


4. Processes read/write to/from port


5. Kernel performs each IPC operation and establishes communication channel

What are advantages and disadvantages to Message-based IPC?

Advantages


1. Simplicity: Kernel manages channel and message passing




Disadvantages


1. Overheads due to system calls

What are some methods of Message-Passing IPCS?

1. Pipes - Carry byte stream between two processes. Output of one process can be input to another process.


2. Message Queues - Carry messages "among" processes.


3. Sockets - Send/Recv messages through kernel communication buffers

Describe Shared-Memory IPC

Processes read and write into a shared region. This region is mapped into the virtual address space of both processes, and points to the same area of physical memory.

Processes read and write into a shared region. This region is mapped into the virtual address space of both processes, and points to the same area of physical memory.

What are advantages and disadvantages to Shared-Memory IPC?

Advantages


1. System calls only in the setup phase




Disadvantages


1. Explicit synchronization


2. Communication protocol & shared buffer management are the programmer's responsibility

What is the end goal of both Message-passing IPC and Shared-memory IPC?

Pass data from one address space into another address space

Placeholder for Copy Vs Map

write it

Placeholder for Copy Vs Map

write it

In SysV Shared-Memory IPC, what is the key?

An element assigned to a shared region of physical memory. This allows other processes to reference this memory segment using this key

SysV Shared-Memory IPC placeholder

Write it

SysV Shared-Memory IPC placeholder

Write it

Regarding the SysV API, what do the following commands do?
shmget()


ftok()


shmat()


shmdt()


shmctl()

shmget - Create or open shared memory


ftok() - Generates memory keys


shmat() - Attaches shared memory segment to process


shmdt() - Detaches a segment based on id


shmctl() - Passes a a control code to a shared memory segment

Regarding the POSIX API, what do the following commands do?


shm_open()


mmap() and unmmap()


shm_close()


shm_unlink()


What is a difference between the POSIX Shared memory API and the SysV Shared memory API?

The POSIX standard uses file descriptors instead of keys

How do you perform IPC sync with Pthreads?

Use PTHREAD_PROCESS_SHARED

Click to see Pthreads IPC example C code

What are some other examples of IPC Synchronization?

1. Message Queues

2. Semaphores


Describe message queues

1. Implement mutual exclusion via send/recv

Describe Semaphores

Operating System construct. Binary value that is similar to a mutex.




Value of 0, process is blocked


Value of 1, the value is decremented (locked) and process proceeds.