Interprocess Communication Flashcards

1
Q

What are the difference between named and ordinary pipes?

A

Ordinary pipes are unidirectional. They can only exist between parent and child process. They can only be used by two processes (one on each end). Named pipes do not have these restrictions.

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

Why is a wait() not a good idea when using ordinary pipes to communicate between processes?

A

Because read() and write() are blocking calls and can be used as a sync point. Calling wait() may result in deadlock.

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

What happens when a process reads from a pipe that has no writer?

A

It receives an EOF

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

What happens to a process writing to pipe that has no reader?

A

It is signalled (to terminate)

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

What are the two ways that processes communicate?

A

Message passing, and shared memory

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

What is message passing?

A

Messages are passed between processes. Requires system calls (kernel intervention).

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

What is shared memory?

A

Both processes have access to shared section of memory, allowing them to communicate.

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

What are co-operating processes?

A

They are processes that can affect each other (communication) while independent processes do not.

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

What is a rendezvous?

A

Both send and receive calls are blocking.

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

What is a rendezvous?

A

Both send and receive calls are blocking, creating a synchronisation point.

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

Things to consider when storing a sent message…

A

We want to minimise copying.

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

Why is direct communication not a great message passing solution?

A

We are directly sending messages to processes (explicitly stating sender pid, or name). This makes changing names of processes difficult. Changing one program might lead to changing multiple.

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

What is indirect communication?

A

Processes communicate through mailboxes (both must have reference to mailbox to communicate). Sender doesn’t need to know which process it is sending to.

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

How is synchronisation handled with shared memory?

A

Explicitly by the programmer, at the user level (i.e. locks)

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

Why are pipes and shared memory initialised before fork()?

A

So that both processes have a reference to them

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

How many processes can receive from a mach port?

A

One. But multiple can send.

17
Q

Can an external process receive from another process’s port?

A

Yes. The port’s receiving process can grant “right” to the other process to receive on its behalf.

18
Q

Can kernel level signal handlers be overidden?

A

Yes, user-level handlers can override kernel handlers. They can be written to ignore signals entirely.

19
Q

Is there a signal that cannot be overridden by user-level handlers?

A

Yes. SIGKILL. 9.

20
Q

What is the windows equivalent for mach ports?

A

Advanced Local Procedure Call (ALPC). Basically mailboxes.