You are on page 1of 3

Assignment 4 – Operating System Fundamentals

1. A process can be terminated due to


a. normal exit
b. fatal error
c. killed by another process
d. all of the mentioned

Ans: (d) all of the mentioned

2. A process stack does not contain


a. Function parameters
b. Local variables
c. Return addresses
d. PID of child process

Ans: (d) PID of child process

3. The following program fragments prints the string “Hello” number of times equal to

if ( fork() == 0)

fork();

printf(“Hello\n);

a. 1
b. 2
c. 3
d. 4

Ans: (c) 3

4. The following program fragment prints the string “Hello” number of times equal to

fork();

fork();

printf(“Hello\n);

a. 1
b. 2
c. 4
d. 8

Ans: (c) 4

5. In UNIX, the “fork()” system call returns –


a. A value of 0 to the child process
b. The process ID of child process to the parent process
c. A value of -1 to the parent process if no child process is created
d. All of the above

Ans: (d) All of the above

6. Which of the following Is NOT correct about thread of any process?


a. Compared to a process, switching between threads of same process takes less time
as quantum allotted for threads is less
b. Inter-thread communication is faster as the threads of one process is share address
space
c. Threads of a process share same address space
d. Compared to a process, switching between threads of same process takes less time
as next-to-run thread shares same address space

Ans: (d) Compared to a process, switching between threads of same process takes less time as
next-to-run thread shares same address space

7. Pipe provides a way of communication among processes. Which one of the following
statements does not hold true for pipe?
a. In named pipes, communication can be bidirectional
b. No parent-child relationships are required in ordinary pipes
c. Ordinary pipes provide a simple communication mechanism between a pair of
processes. Once a named pipe is established, several processes can use it for
communication.
d. None of the above

Ans: (b) No parent-child relationships are required in ordinary pipes

Named pipes may have a bidirectional communication mechanism. Ordinary pipes involves a
relatively simpler method of communication between pair of processes. But, parent child
relationship might be required in ordinary pipes.

8. Inter Process Communication (IPC) mechanism/techniques are-


a. Signals, Pipes and Threads
b. Message Passing, Signals and Threads
c. Pipes, Signals and Message passing
d. Threads, Pipes and Message passing
Ans: (c) Pipes, Signals and Message passing

9. How concurrency differs from parallelism?


a. Concurrent system allows more than one task to run while parallel system does not.
b. Parallel system allows more than one task to run while concurrent system does not.
c. Concurrent system can allow more than one task to run whereas parallel system can
perform more than one task simultaneously.
d. It is not possible to have concurrency without parallelism.

Ans: (C) Concurrent system can allow more than one task to run whereas parallel system can perform
more than one task simultaneously

10. Which of the following is incorrect about named pipes?


a. No parent child communication is necessary between the communication processes
b. Only one process can use the named pipe for communication
c. Bidirectional communication is enabled
d. Provided on both Windows and UNIX

Ans: (b) Only one process can use the named pipe for communication

Multiple processes can use the named pipe for communication. Named pipes can be used for
bidirectional processes and it exists for both windows and UNIX. Parent child communication is not
necessary between the communication processes. Hence, only option b is incorrect.

11. User threads are supported –


a. Above the kernel and are managed with kernel support
b. Below the kernel and are managed without kernel support
c. Above the kernel and are managed without kernel support
d. Below the kernel and are managed with kernel support

Ans: (c) Above the kernel and are managed without kernel support

12. Remote Procedure Calls are used for:


a. communication between two processes remotely different from each other on the
same system
b. communication between two processes on the same system
c. communication between two processes on separate systems
d. None of the mentioned

Ans: (c) for communication between two processes on separate systems

Two processes residing on two different systems can communicate among themselves by means of
remote procedure calls.

You might also like