slides04 Flashcards

1
Q

cooperating processes and reasons for using them

A

-can affect or be affected by another process
-reasons:P
1. information sharing
2. computation speedup
3. modularity

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

two models of IPC

A
  1. shared memory
  2. memory passing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

shared memory

A
  • in user mode
  • physical or virtual memory that is accessible to both processes
  • producer/consumer does the following to access shared memory:
    1. create shared memory (must be on same computer)
    2. map shared memory into their address spaces
    3. read/write to shared memory
  • tradeoff: cost of setting up shared memory space vs quick read/write
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

message passing

A
  • suitable for small number of message transfers
  • processes read/write to a message queue in kernel
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

types of communication links (3)

A
  1. direct vs indirect
  2. synchronous vs asynchronous
  3. automatic vs explicit buffering
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

direct vs indirect communication links

A

DIRECT
- 2 processes must be able to address each other
- advantages: processes could have multiple communication links

INDIRECT
- through a mailbox or port
- messages are consumable -> once consumed, it is no longer available

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

advantages/disadvantages of indirect communication links

A

advantages:
- sender/receiver identities can change and communication program does not need to be updated eg. zoom

disadvantages
- higher delay of sending messages
- number of messages that can be sent is lower

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

mailboxes vs ports

A
  • ports only have one consumer; we know exactly where our message is going
  • mailboxes can have multiple consumers; more fault tolerance, load balance between consumers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

synchronization with message passing

A
  • message passing can be blocking or non-blocking

BLOCKING (SYNCHRONOUS)
- blocking send: sender is blocked until message is received
- blocking receive: receiver is blocked until message is available

NON-BLOCKING (ASYNCHRONOUS)
- non-blocking send: sender sends msg and continues
- non-blocking receive: receiver receives either a valid msg or a null msg
- minimizes wait times

  • if both sender/receiver are synchronous: RENDEZVOUS (they reach and leave a point in execution at the same time)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

buffering in communication links

A
  1. zero capacity: no messages are queued in link. sender must wait for the receiver
  2. bounded capacity: finite length of n messages. sender must wait if buffer is full
  3. unbounded capacity: infinite length. sender never waits.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly