Week 4 Solution
Week 4 Solution
Q1.
Choose the false statement.
(A) The wait() system call blocks the parent process until one of its child processes exits.
(B) The wait() system call helps a child process to return its exit status value to the parent
process.
(C) The wait() system call reclaims resources that were used by the child process.
(D) The wait() system call returns a negative value to the OS if the child process is
abnormally terminated.
(E) The wait() system call returns a zero value to the OS if the child process is normally
terminated.
Ans: (C) The wait() system call reclaims resources that were used by the child process.
Q2.
In the UNIX environment, the output of the following program is a
#include<stdio.h>
#include<sys/types.h>
#include<unistd.h>
int main()
{
int pid;
pid = fork();
if(pid == 0)
{
sleep(100);
}
else
{
printf("I am parent process");
}
return 0;
}
Q4.
A process terminates when
Q5.
The objective of Interprocess Communication (IPC) is to
Q6.
Message-passing interprocess communication allows multiple cooperating processes
Ans: (B) to synchronize their actions without sharing the same address space.
Q7.
Shared-memory interprocess communication
Q8.
In indirect interprocess communication between two processes, which of the following are
two valid operations
Q9.
In direct interprocess communication between two processes, a communication link is
Q10.
In the non-blocking (asynchronous) message-passing, the sending process
(A) keeps sending until the receiving process receives the message.
(B) sends the message and resumes operation.
(C) keeps sending until it receives a message from another process.
(D) retrieves either a valid message or a null.
(E) is blocked until the message is received by the receiving process.
Q12.
A multicore system
Q13.
Which of the following statements is true?
Q14.
Which of the following system calls is not supported by the Unix operating stsem?
(A) abort()
(B) wait()
(C) pipe()
(D) sleep()
(E) CreateProcess()