Machine-translated by Google. Questions are authored in English.
Top

Processes and Threads Questions and Answers

11.

A process in the "ready" state is

Exam Year(s)

Tripura Public Service Commission - 2026,

Answer: C

A process in the ready state is ready to run on CPU.

A ready process is in main memory and has everything it needs except the processor. It waits in the ready queue until the scheduler dispatches it, at which point it moves to the running state.

A process that is executing is in the running state. A process waiting for I/O is in the waiting (blocked) state; it cannot use the CPU even if offered until its I/O completes. A terminated process has finished, and the OS is only reclaiming its resources.

Please log in or register to report this question.

12.

Which process can be affected by other processes executing in the system ?

Exam Year(s)

Tripura Public Service Commission - 2019,

Answer: A

The answer is a cooperating process.

A process is cooperating if it can affect or be affected by other processes executing in the system, for example by sharing data or exchanging messages. A process that shares nothing with others is independent.

Child and parent describe how processes were created, and init is the first user process in Unix; none of these terms defines whether a process is affected by others.

Please log in or register to report this question.

Answer: B

In a zero capacity queue, the sender blocks until the receiver receives the message.

A queue with zero capacity cannot hold any messages waiting in it. Every message must therefore be handed over directly, so the sender has to wait until the receiver takes it. This arrangement is called a rendezvous.

A queue that can store at least one message has bounded or unbounded capacity, and only a queue with unbounded capacity lets the sender keep sending without ever blocking.

Please log in or register to report this question.

14.

What is the purpose of the "fork" system call in UNIX-like operating systems ?

Exam Year(s)

Tripura Public Service Commission - 2025,

Answer: B

fork is used to create a new process.

The fork() system call creates a child process that is a copy of the calling process. It returns 0 in the child and the child's process ID in the parent, so the two can take different paths.

A process ends with exit(), scheduling is done by the kernel scheduler, and a new program is loaded into a process with exec(), which is often called right after fork.

Please log in or register to report this question.

Answer: C

A multithreaded process is a process that consists of multiple threads of execution.

Threads are separate paths of execution within one process. They share the process's memory and resources but each has its own program counter, registers and stack, so different parts of the program can run concurrently.

A process does not contain multiple independent programs; running on several CPUs is a possible benefit of threads, not their definition; and handling several I/O devices does not make a process multithreaded.

Please log in or register to report this question.

16.

Which of the following does not interrupt a running process ?

Exam Year(s)

Tripura Public Service Commission - 2025,

Answer: C

The one that does not interrupt a running process is the Scheduler process.

Interrupts are hardware signals. A device raises one when an I/O operation completes, the timer raises one when a time slice expires, and a power failure triggers a high-priority interrupt so the system can save its state.

The scheduler is operating system code that runs only after an interrupt or system call has already handed control to the kernel. It chooses the next process but does not itself interrupt the running one.

Please log in or register to report this question.

17.

A process executes the code

fork();
fork();
fork();

The total number of child processes created is

Exam Year(s)

Tripura Public Service Commission - 2025,

Answer: C

The number of child processes is 7.

Each fork() doubles the number of processes, since both parent and child carry on to the next line. After three calls there are \(2^{3} = 8\) processes. One of them is the original, so

\[ 2^{3} - 1 = 7\ \text{child processes} \]

8 counts the original process as a child, and 3 assumes only the original process calls fork each time.

In general, n calls to fork() in sequence produce 2 to the power n processes in all, of which 2 to the power n minus 1 are children.

Please log in or register to report this question.

18.

In Unix, which system call creates the new process ?

Exam Year(s)

Tripura Public Service Commission - 2019,

Answer: A

The system call is fork.

fork() creates a new child process that is a copy of the calling parent. It returns 0 in the child and the child's process ID in the parent, which is how the two tell themselves apart; the child usually then calls exec() to run a different program.

There are no Unix system calls named create or new for processes; the similar-looking creat() creates a file. So 'None of the above' is also wrong.

Please log in or register to report this question.

Answer: A

The statement that is not true is that process 0 is called the init process. Process 0 is the first, special process that the kernel creates when the system boots, and it is not made by the fork system call. It forks process 1, which is the init process, and afterwards process 0 becomes the swapper (scheduler) process.

The other three statements are true: it is not created by fork, it becomes the swapper after forking process 1, and it is a special process created at boot.

Please log in or register to report this question.

20.

Which of the following commands would return process_id of sleep command ?

Exam Year(s)

UGC NET - 2013,

Answer: D

The command that returns the process id of a background sleep command is "Sleep 1 and echo $!" (the shell variable $! holds the process id of the most recently started background command). The ampersand, which the printed text spells as "and", puts sleep in the background.

The variable $? gives the exit status of the last command, $# gives the number of positional parameters, and the printed $ with a multiplication sign is not the process id variable. Only $! gives the id of the background process.

Please log in or register to report this question.

Loading…
Tags: Processes and Threads Questions and Answers || Processes and Threads MCQ Questions and Answers || Processes and Threads GK Questions and Answers || Processes and Threads GK MCQ Questions || Processes and Threads Multiple Choice Questions and Answers || Processes and Threads GK || GK on Processes and Threads || Operating Systems Questions and Answers || Operating Systems MCQ Questions and Answers || Operating Systems GK Questions and Answers || GK on Operating Systems