0% found this document useful (0 votes)
46 views5 pages

Week 4 Solution

This document contains 15 multiple choice questions about operating system fundamentals from an assignment given by Prof. Santanu Chattopadhyay at IIT Kharagpur. The questions cover topics like process termination, interprocess communication using pipes and messages, differences between threads and processes, and system calls like wait(), fork(), and pipe(). Sample answers are provided for each question.

Uploaded by

selvaraj79bc19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views5 pages

Week 4 Solution

This document contains 15 multiple choice questions about operating system fundamentals from an assignment given by Prof. Santanu Chattopadhyay at IIT Kharagpur. The questions cover topics like process termination, interprocess communication using pipes and messages, differences between threads and processes, and system calls like wait(), fork(), and pipe(). Sample answers are provided for each question.

Uploaded by

selvaraj79bc19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Operating System Fundamentals

Prof. Santanu Chattopadhyay


IIT Kharagpur
Assignment 4 (Week 4)

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;
}

(A) orphan child process.


(B) zombie child process.
(C) blocked child process.
(D) aborted child process.
(E) aborted parent process.

Ans: (A) orphan child process


Q3.
In UNIX Operating System (OS), an orphan process is a computer process

(A) whose parent process has finished, but it is running.


(B) that is adopted by the “init” process.
(C) whose parent process returns all the resources to the OS.
(D) whose process id is unique.
(E) All of the above

Ans: (E) All of the above

Q4.
A process terminates when

(A) it attempts to access a memory location to which access is not permitted.


(B) its parent process request to terminate it.
(C) it executes an illegal instruction.
(D) it exceeds the waiting time for an event to occur for which the process is waiting.
(E) All of the above.

Ans: (E) All of the above

Q5.
The objective of Interprocess Communication (IPC) is to

(A) share data among the processes.


(B) communicate among multiple processes.
(C) solve a large problem with the help of multiple cooperating processes.
(D) synchronize the activities of multiple cooperating processes.
(E) All of the above.

Ans: (E) All of the above

Q6.
Message-passing interprocess communication allows multiple cooperating processes

(A) to exchange information without the kernel.


(B) to synchronize their actions without sharing the same address space.
(C) to communicate by sharing the same address space.
(D) which must be run in the same computer system.
(E) using the fork() system call.

Ans: (B) to synchronize their actions without sharing the same address space.
Q7.
Shared-memory interprocess communication

(A) can be done at memory speed.


(B) allows multiple processes to exchange information via kernel.
(C) does not need process synchronization.
(D) Does not need a shared region of memory.
(E) supports delete() and receive() operations.

Ans: (A) can be done at memory speed

Q8.
In indirect interprocess communication between two processes, which of the following are
two valid operations

(A) delete() and add().


(B) send() and receive().
(C) delete() and send().
(D) add() and receive()
(E) open() and close().

Ans: (B) send() and receive().

Q9.
In direct interprocess communication between two processes, a communication link is

(A) only bidirectional.


(B) only unidirectional.
(C) established only if processes share a common mailbox.
(D) may be associated with many processes.
(E) is associated with exactly one pair of communicating processes

Ans: (E) is associated with exactly one pair of communicating processes

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.

Ans: (B) sends the message and resumes operation.


Q11.
The pipe() system call

(A) is used for one-way communication of a stream of bytes.


(B) is used for two-way communication of a stream of bytes.
(C) creates three file descriptors.
(D) created a structured file.
(E) uses nonblocking I/O operation.

Ans: (A) is used for one-way communication of a stream of bytes.

Q12.
A multicore system

(A) supports multithreading.


(B) multiple threads can execute concurently.
(C) improves system performance through multithreading.
(D) sharing resources mong threads is easier than shared memory.
(E) All of the above.

Ans: (E) All of the above

Q13.
Which of the following statements is true?

(A) Threading increasing the throughput of the system.


(B) Resource sharing among threads is easier than the same among processes.
(C) Multiple threads share common address spece.
(D) Thread communication is easier than interprocess sommunication.
(E) All of the above.

Ans: (E) All of the above

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()

Ans: (E) CreateProcess()


Q15.
In direct or indrect interprocess communication

(A) messages are stored in a temporary buffer.


(B) none of the messages are waiting in a zero capacity buffer.
(C) the sender is blocked for the bounded capacity buffer if it is full.
(D) the sender is not blocked for the unbounded capacity buffer.
(E) All of the above.

Ans: (E) All of the above

You might also like