True or false: A process is passive code stored on a device, while a program is the code in execution.
2 Processes and Interprocess Communication Online Quiz Questions
Use this free practice quiz with 20 questions to review 2 Processes and Interprocess Communication, test your knowledge, and prepare for your next test or exam.
A process has requested input and cannot continue until that input arrives. Which state is it in?
- A
Ready
- B
Blocked
- C
Running
- D
Terminated
True or false: When a process calls an exec function, it continues to exist while its program image is replaced.
- A
True
- B
False
In a common Unix-like process pattern, creates a child process, and replaces the current program image with a different program.
What is the term for a child process that has terminated but whose parent has not yet collected its status?
A shell connects a producer's output directly to a consumer's input through a byte stream. Which IPC mechanism is being used?
- A
Pipe
- B
Message queue
- C
Shared memory
- D
Signal
Which of the following are message-passing IPC mechanisms? Select all that apply.
- A
Pipes
- B
Shared memory
- C
Message queues
- D
Semaphores
- E
Sockets
- F
Named pipes (FIFOs)
On Linux, what technique is initially used for a child's memory after fork(), instead of immediately copying every memory page?
A running process is preempted because its time slice ends. Which state may it move to next?
- A
Blocked
- B
Ready
- C
Terminated
- D
New
Signals are primarily used for , rather than for transferring large amounts of data.
Which statements about shared memory are accurate? Select all that apply.
- A
Processes map the same memory region into their address spaces.
- B
The operating system passes each data item through a message channel.
- C
Processes exchange data by reading and writing the shared region.
- D
Synchronization may be needed to avoid conflicting updates.
- E
It cannot be used for frequent exchanges.
On a Unix-like system, which operation can a parent use to collect a terminated child's exit status and allow remaining bookkeeping to be released?
- A
exec()
- B
fork()
- C
wait() or waitpid()
- D
A pipe read
Two processes on the same machine need a socket-based communication mechanism designed for local communication. Which should they use?
- A
Network sockets only
- B
Unix-domain sockets
- C
Message queues
- D
Signals
A system must transfer large amounts of data frequently between processes. Compare message passing with shared memory for this use case, and identify an important coordination requirement for the approach that uses a shared region.
A process waiting for input cannot continue until that input arrives. In the common process-state model, is the process blocked while it waits?
- A
True
- B
False
A running process has more work to do, but the scheduler ends its time slice so another process can use the CPU. Which state should the first process enter?
- A
Blocked, because preemption means the process is waiting for an event.
- B
Ready, because it can run again but must wait for CPU time.
- C
Terminated, because its time slice has ended.
- D
New, because the scheduler must create it again.
A child process calls an exec function after being created with fork(). Which outcome describes what happens to the child?
- A
The parent process is terminated and replaced by the new program.
- B
A new PID is assigned to the child, while its original program keeps running.
- C
The process continues, but its program image is replaced by the new program.
- D
The new program is started as a thread in the parent process.
A process has everything it needs to continue, but the CPU is currently running another process. In the common process-state model, what state is it in?
A shell must connect one program's output directly to another program's input as a stream of bytes. Which IPC mechanism best fits this design?
- A
A pipe, which carries a byte stream from a write end to a read end.
- B
A signal, which transfers the producer's complete output as data.
- C
A process identifier, which carries output between programs.
- D
A semaphore, which stores the producer's output for the consumer.
On a Unix-like system, which system call can a parent use to collect a terminated child's exit status? Give one common call name.