IPC for Data Passing Flashcards

1
Q

IPC

A

Inter-Process Communication

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

Pipe

A
  • IPC technique for passing information to another process
  • uses byte-stream
  • only for use between child and parent
  • one reader and one writer
  • purely in-memory
  • pipe is deleted after all fds closed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Byte-Stream

A

Message that has no notion of “boundaries”. No space division between messages

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

pipe()

A

int pipe( int fd[2] )
- creates a new pipe and returns two file descriptors
- f[0] is read end
- f[1] is write end

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

fork()

A

Child inherits fd[0] and fd[1]

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

close()

A

Closes unused file descriptors

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

How do pipes work under the hood?

A
  • in-memory file system,PIPEFS, in the kernel memory address space
  • pipefs mounted at system initialization
  • pipe corresponds to a file created in pipefs
  • pipe() creates pipe and returns two file descriptors (one read and one write)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

FIFO

A

Named Pipe.
- uses byte-stream
- not limited to be used between parent and child process
- multiple writers and one reader
- file created in hard disk, but I/O through kernel memory
- not deleted after closing all fds

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

Message Queues

A

Like named pipe but supports boundaries and message types/priorities

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

Unix Domain Socket

A
  • like a pipe combined with a message queue
  • named using path name
  • supports byte-stream and datagrams
  • bidirectional
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Shared Memory

A

Region of physical memory that is mapped to two (or more) processes, both can edit and view same data

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