0% found this document useful (0 votes)
5 views11 pages

Processes

The document contains a quiz on operating systems focusing on processes and threads, covering topics such as process states, scheduling, thread management, and interprocess communication. It includes multiple-choice questions that assess understanding of concepts like zombie processes, thread pools, and the differences between various scheduling models. The quiz is designed to test knowledge of key operating system principles and terminologies.
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)
5 views11 pages

Processes

The document contains a quiz on operating systems focusing on processes and threads, covering topics such as process states, scheduling, thread management, and interprocess communication. It includes multiple-choice questions that assess understanding of concepts like zombie processes, thread pools, and the differences between various scheduling models. The quiz is designed to test knowledge of key operating system principles and terminologies.
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/ 11

OPERATING SYSTEMS QUIZ

TOPIC 2. PROCESSES AND THREADS

Which kind of processes are stored in the ready queue?


1. Ready queues do not store any processes, it is a reserved space of the system
2. Those processes that reside in main memory and are ready and wai>ng to be executed
3. The processes that are wai>ng for I/O device
4. All the answers are correct

What is a zombie process?


1. A process which has terminated, but whose parent has not called the wait system call yet
2. The resul>ng process of execu>ng wait before the parents process execu>on
3. A process which is removed out of memory because it is no longer required
4. All the answers are wrong

If you had to save private data, why should you never use threads?
1. It takes a lot of >me accessing to a thread
2. Its response >me is very short, but it requires the consump>on of many hardware resources
3. None of these answers is correct. Threads can be used to save private data safely.
4. Threads share the same data space, thus one thread can steal private data from the other.

Select the incorrect answer: Process Control Blocks...


1. Are stored in a global process table
2. Store informa>on related with the program counter
3. Store informa>on related with the CPU registers
4. Are deleted when the process related to it is stopped

Select the correct answer:


1. POSIX Pthreads are implemented in user level and kernel level
2. Win32 library is implemented only in user level
3. Java library relies on the configura>on of the Java API, which varies from one OS to another
4. None of the answers are correct

What is the heap of a process?


1. The name and iden>fica>on code of the process.
2. The code of the process.
3. Dynamically allocated memory.
4. A piece of previously allocated memory containing global variables.

What is a zombie process?


1. A process with completed execu>on which s>ll has an entry in the process table.
2. A process that was stopped in the middle of its execu>on and has not been completely
terminated.
3. A process without father.
4. A process that has exceeded allocated resources.

Which one of these sentences describes the many-to-one mul>threading model?


1. Allows mul>ple threads to run in parallel on mul>processors.
2. Several kernel threads are mapped to a single user thread.
3. If a thread makes a blocking system call the kernel manages another thread for execu>on.
4. The en>re process is blocked if a thread makes a blocking system call.
When a parent process create a child process by means of a fork():
1. Both parent and child process share the pid.
2. The return code for the fork() is zero for the parent process, whereas the parent process
iden>fier (nonzero) is returned to the child.
3. If the parent process is killed, its children processes will become orphans and will have no
parent to collect their status.
4. The return code for the fork() is the child’s pid for the parent process, whereas a zero value is
returned to the child.

Processes migrate during its life>me through the different queues, therefore, for scheduling purposes:
1. A long-term scheduler is needed to select the next ac>ve process to be executed and allocate
CPU for it.
2. A short-term scheduler is needed to select process to be brought into the ready queue from
disk.
3. A medium-term scheduler can be used to improve the process mix by swapping processes in
and out the CPU.
4. All the previous are correct.

If we want to terminate a thread before it has competed its execu>on:


1. It is not possible to terminate a thread before it completes.
2. The target thread is terminated immediately.
3. The target thread can be configured to periodically check whether it should terminate. If so, it
terminates itself.
4. Both b) and c)

Select the correct statement:


1. There are two different schedulers: CPU scheduler, in charge of selec>ng the process from the
ready queue and I/O scheduler selec>ng the process in the I/O queue
2. The Short-term scheduler is much slower than the Long-term scheduler.
3. The Short-term scheduler selects which process should be executed next in the CPU.
4. The Long-term scheduler selects which processes should abandon the CPU and terminates
them.

In thread cancella>on:
1. There are three approaches: Synchronous cancella>on, Asynchronous cancella>on and
Deferred cancella>on.
2. Synchronous cancella>on allows the target thread to periodically check if it should be
cancelled.
3. Asynchronous cancella>on terminates the target thread immediately.
4. The cancella>on points are those from where the OS can recover the threads terminated since
that moment, they are assigned periodically by the kernel.

The process memory space does not include...:


1. Stack
2. Code sec>on
3. State
4. Data sec>on

The Many-to-Many model...:


1. Is a many user-level threads mapped to single kernel thread
2. Allows many user level threads to be mapped to many kernel threads
3. Allows a user thread to be bound to kernel thread
4. Has a expensive crea>on of kernel threads

What happens when a parent exits and its child processes s>ll runs?
1. Only the child PCB is destroyed.
2. The child process becomes an zombie process
3. The child process becomes an orphan process
4. None of the above.

What is a process?
1. A program.
2. An executable file.
3. An ac>ve en>ty with a set of associated resources.
4. A file containing a list of instruc>ons stored in a disk.

Thread pools:
1. Are a possible solu>on for mul>-threading problems.
2. Contain the maximum threads available depending on the amount of memory.
3. Are usually faster and efficient.
4. All previous answers are correct.

Which of the following statements is correct?


1. The short-term scheduler can temporarily remove a process from main memory (swap out).
2. The mid-term scheduler can temporarily remove a process from main memory (swap out).
3. The short-term scheduler decides what jobs will be admi_ed to the ready queue.
4. The mid-term scheduler decides what jobs will be admi_ed to the ready queue.

Select the false statement. When cancelling a thread in asynchronous mode:


1. The cancel request will be delivered immediately.
2. The cancel request will wait un>l the thread reaches a cancella>on point
3. You have a risk of causing memory leaks.
4. You have a risk of blocking other threads forever.

Which one is the frequency of a short-term scheduler?


1. Seconds.
2. Milliseconds.
3. Minutes.
4. Hours.

Which of the following is NOT shared by threads of one process?


1. Code.
2. Open files.
3. Signals.
4. Registers

When a process is in the state running and changes to ready, what has happened?
1. It has been interrupted
2. It is wai>ng for and event
3. It is ready to exit
4. None of the above

In UNIX systems, what is the func>on of fork?


1. Exit a program
2. Fork system call interrupts a process for wai>ng an I/O device
3. Fork system call creates new process
4. Fork system replace the process memory space with a new program

The Many-To-Many model allows to:


1. Allows many user level threads to be mapped to many kernel threads
2. Allows many kernel level threads to be used as user threads
3. Have only one kernel thread
4. Rewrite the scheduler and the dispatcher

What does it mean that a process terminates in a Zombie termina>on?


1. That a process has completed execu>on but s>ll has an entry in the process table.
2. That a process has no father, so it has not a entry in the process table.
3. That a process is unable to create child processes, because it is corrupted.
4. That a process has no father.

Choose the incorrect answer.


1. Threads are created slower than processes
2. Threads share resources inside each process
3. Several tasks can be performed concurrently
4. Threads can run on a mul>processor system in parallel

What is the incorrect answer. What is a zombie process?


1. A process with no process control block (PCB)
2. A PCB with no process
3. A process that terminates other processes
4. None of the above

Which of the following is a model of interprocess communica>on (IPC)?


1. Interrupts
2. Create a process that acts as a messenger
3. Message passing
4. Process don’t communicate with each other

What is the difference between preemp>ve and nonpreemp>ve scheduling?


1. Non-preemp>ve scheduling is more efficient than premp>ve
2. In preemp>ve scheduling there are no interrup>ons
3. In preemp>ve scheduling there are interrup>ons while in nonpreemp>ve there are not.
4. A process runs all the >me in CPU with non-preemp>ve scheduling.

What is the difference if any between parallelism and concurrency


1. Parallelism refers to allowing more than one task to make progress and concurrency refers to
running more than one task simultaneously.
2. Parallelism refers to running more than one task simultaneously and concurrency refers to
allowing more than one task to make progress.
3. Both are the same.
4. With concurrency only one task is executed, with parallelism there are executed several tasks.

Which of the following op>ons occur when we cancel a thread using deferred cancella>on?
1. Resources remain unallocated
2. Terminate immediately the thread without checking
3. Cancella>on will occur ader being processed by the cancelled thread
4. None of the above can happen

Which of these sentences is correct?


1. If a parent process does not collect the exit code of a child process with wait, the child process
becomes an orphan adopted by init process, with pid = 1.
2. The ready queue selects which process should be executed next
3. A process may include the text sec>on, data sec>on, program counter, stack and heap
4. If a process is wai>ng for some event to occur, such as recep>on of a signal, it is in the ready
queue.

Which of these process components are not shared across threads in a mul>thread process?
1. The code of the program
2. The global variables
3. The stack
4. The files

Which of these characteris>cs is not a benefit of mul>thread processes?


1. Easiness of debugging
2. Responsiveness
3. Economy
4. Scalability

Which of the following sentences about interprocess communica>on is True?


1. Message passing is faster than shared memory but it may create conlicts
2. Message passing is useful for small amounts of data but it takes more >me than shared
memory.
3. Shared memory use way more system calls than message passing
4. All of the previous sentences are false

Which of the following is NOT a valid Mul>threading model? (User to Kernel)


1. One to Many
2. Many to one
3. Many to many
4. One to one

Choose the correct statement related with the interprocess communica>on:


1. An independent process never needs to perform interprocess communica>on.
2. A coopera>ng process can affect or be affected by the execu>on of another process, without
including sharing data.
3. Coopera>ng processes need interprocess communica>on(IPC), which are message passing and
shared memory.
4. None of the above.

Choose the correct statement related to the many-to-many model:


1. The advantage of this model is that when one user thread blocks, the rest can execute if they
are assigned to a different kernel thread.
2. It allows the opera>ng system to create a sufficient number of kernel threads.
3. An example of this model is IRIX.
4. The context switch is in user lever, which makes it fast.

What is a job scheduler?:


1. It is a scheduler that selects processes from the pool of jobs pending to execute and loads them
into memory.
2. It is a scheduler that selects processes with more frequency than the CPU scheduler
3. It is a scheduler that selects from among the processes that are ready to execute and allocates
them on the CPU.
4. It is a scheduler not in charge of the degree of mul>programming.

What happens when a child process is terminated?:


1. The parent of the process terminates also, always.
2. All the resources of the process are deallocated by the CPU.
3. No resources are deallocated so they can be used by other process and therefore maximize
CPU usage.
4. All the resources of the process are deallocated by the Opera>ng System.

In a mul>threaded program, a signal is usually delivered to:


1. Every thread in the process.
2. Certain threads in the process.
3. A specific thread that receives all the signals for the process.
4. All the op>ons can be correct.

What is the difference between the process state of ‘Ready’ and ‘Wai>ng’?
1. During the ‘Ready’ state the process is wai>ng un>l a certain event occurs, whereas ‘Wai>ng’
indicates the process is wai>ng on itself to finish
2. During the ‘Ready’ state the process is wai>ng to be assigned to a processor, whereas ‘Wai>ng’
indicates the process is wai>ng for an event to occur
3. During the ‘Ready’ state the process is ready to receive the next instruc>on, whereas ‘Wai>ng’
indicates the process is busy and can’t receive the next instruc>on
4. During the ‘Ready’ state the process is wai>ng to be assigned to a processor, whereas ‘Wai>ng’
indicates the process’s instruc>ons are being executed

Which of the following is false.


1. A running process could make an I/O request and then be placed in an I/O queue
2. All of them are false.
3. A running process could be removed forcibly by the CPU and terminated
4. A running process could be removed forcibly the CPU and be put back in the ready queue

Where the processes ready to execute can be found?


1. In hard disk.
2. In ready queue.
3. It is always only one process ready to execute.
4. All processes which are ready are immediately executed.

What is a device queue?


1. The list of processes wai>ng for par>cular I/O device.
2. The list of devices wai>ng for access to the processor.
3. It is other name of ready queue.
4. It is mechanism which can be found only in Linux.

What part of the OS design can be affected by using or not using preemp>on?
1. The scheduler
2. The file system manager
3. Both a and b are correct
4. Neither a nor b are correct

What are drawbacks of process-based servers?


1. It is necessary to fork for each new request, and it has a high resource use
2. It is necessary to destroy a process for each processed request and it consumes auxiliary
graphic card processor
3. It is necessary to destroy a process for each processed request and it can destroy threads
4. It can destroy threads and it has a high resource use.

In which scheduling algorithm can we find a ‘convoy effect’?


1. Priority scheduling algorithm
2. Shortest-job-first scheduling (SJF)
3. Round-Robin scheduling (RR)
4. First-come, first-served scheduling algorithm (FCFS)

The >me quantum in the Round-Robin scheduling algorithm…


1. It should be small compared with the context switch.
2. If it is too large, RR degenerates to FCFS.
3. If it is too small, RR creates the appearance that each process has its own processor (processor
sharing).
4. Both b) and c) are correct.

Select the correct statement concerning the process schedulers:


1. A scheduler with a First Come First Served policy is always preemp>ve since each process that
arrives to the wai>ng queue goes directly to the processor.
2. Using a round robin scheduler with a very big >me quantum is the same than using a shortest
job first (SJF) scheduling since those processes with shortest burn >me will be executed first.
3. The round robin scheduler preempts the running process when the >me quantum has been
consumed and adds this process to the end of the wai>ng queue.
4. The main advantage of using Priority Scheduling is the avoidance of the problem of starva>on,
as this policy is a non-preemp>ve one.

For op>mizing scheduling criteria, which of the next ac>ons would be appropriate?
1. Maximize throughput, minimize turnaround >me.
2. Maximize throughput, maximize turnaround >me.
3. Minimize throughput, maximize turnaround >me.
4. Minimize throughput, minimize turnaround >me.

Which of this schedulers cannot be used with a not preemp>ve scheduler?


1. First-Come, First-Serve (FCFS).
2. Shortest-Job-First (SJC).
3. Round-Robin (RR).
4. All of them can be used non preemp>vely.

Aging is:
1. A problem that is produced when a process with low priority is never executed
2. A problem that is produced when a process with high priority never stops execu>ng
3. A solu>on that consists of increasing the priority as >me passes by of a process which is not
executed
4. None of them are correct

Which of the following statements is true


1. The FCFS algorithm ensures the shortest wai>ng >mes.
2. Round Robin is the same as Priority Scheduling but with limited >me quantum.
3. It’s always best to have a very short quantum for the Round Robin
4. It’s always best to have a very long quantum for the Round Robin

The dispatcher is...


1. The program that decides the kind of scheduler is going to be used
2. The program that switches from a process selected by the short-term scheduler to another one
3. A kind of scheduling similar to First-Come, First-Served
4. None of the answers are correct

What is the main characteris>c of preemp>ve scheduling?


1. It interrupts the actual process if another may be executed
2. It does not interrupt the actual process if needed
3. It is the same as Round Robin scheduling
4. It uses a special memory address for scheduling the processes

The convoy effect happens...


1. When a process with low CPU burst arrives to the CPU before the processes with high CPU in a
FCFS scheduling
2. When a process with high CPU burst arrives to the CPU before the processes with low CPU in a
Round Robin scheduling
3. When a process with high CPU burst arrives to the CPU before the processes with low CPU in a
FCFS scheduling
4. When two processes arrives to the CPU with the same priority at the same >me in a Priority
Scheduling

The real difficulty of the SJF scheduling algorithm is:


1. Knowing the length of the next CPU request for long-term scheduling.
2. Knowing the length of the next CPU request for short-term scheduling.
3. Solving the problem of starva>on.
4. Both a) and b) are correct.

The SJF scheduling takes into account:


1. The turnaround >me of the processes
2. The length of its CPU burst.
3. The length of its I/O burst
4. The overall number of processes

Which of these scheduling algorithms allows processes to move between queues?


1. Mul>level queue scheduling algorithm
2. Mul>level feedback queue scheduling algorithm
3. Both algorithms allow processes to move between queues
4. None of the previous answers is correct

When we say that a scheduler follows a preem>ve algorithm we say that...


1. It follows the Round Robin algorithm
2. It does not interrupt a process un>l its task has been finished
3. It can interrupt the process before it has finished
4. It can manage all the queues at the same >me

In the context of a process termina>on, the value pased to exit(n) func>on, upon failure is
1. 1
2. 0
3. Any non-zero
4. Answers a) and b) are correct

Select the correct answer, when a process is duplicated (fork):


1. It duplicates open files table
2. Shares intermediate table with i-nodes and posi>ons
3. A and B are correct
4. A and B are incorrect

Which one has the less access >me?


1. Cache
2. Main memory
3. Registers
4. Disk storage

What scheduling method is used by most of the current Opera>ng systems?


1. First to come first to serve
2. Shortest Job First
3. Round Robin
4. Shortest Job First with priority

Select the correct answer:


1. First to Come First to Serve is a preemp>ve algorithm.
2. Shortest Job First is always a preemp>ve algorithm.
3. Round-Robin is a preemp>ve algorithm.
4. All the previous answers are incorrect.

Can the Shortest Job First Scheduling algorithm affected by starva>on?


1. It can
2. No it can never happen
3. It can only happen if the system has a lot of I/O usage
4. None of these answers

The scheduling algorithm called shortest job first has a limita>on, and that is:
1. When a process takes too long, it is physically impossible to be used
2. You have to know beforehand the dura>on of the processes
3. It is very inefficient
4. None of the above

What is SWAP used for in the lifecycle of a process?


1. To make process I/O
2. To increase mul>programming by sending some processes to swap area
3. To make the threads of a process easily configurable by means of an STD
4. To make the system boot faster

Select the correct answer about PCB:


1. All informa>on referred to a process is stored in its PCB.
2. When a process execu>on is finalized, the PCB is released.
3. Data can be shared in the PCB.
4. All the previous answers are incorrect.
Which of the following ac>ons is performed by the wait( ) system call?
1. Returns the PID of the parent process.
2. Blocks process un>l a child terminates.
3. Returns the PID of the currently executed child.
4. A, B and C are performed.

What is the environment of a process?


1. Set of process communica>ons.
2. Condi>ons at the beginning of a process.
3. Mechanism to allow the execu>on of a process.
4. Mechanism to pass informa>on to a process.

SIGILL, SIGALRM and SIGKILL are examples of a basic element in inter-process communica>on, which
one?
1. Excep>ons
2. Timers
3. Signals
4. Pipes

For the fork() system call in Linux, which of the following is true?
1. The fork() process takes in an argument and returns a process ID.
2. The process ID of the parent process is 0.
3. A child process is created but it does not execute the fork() func>on.
4. When fork() is executed, an iden>cal copy of its address space is created as well as its PCB.

Which is correct basic lifecycle of process ?


1. Ready-running-blocked
2. Start-finish-running
3. Ready-block-running
4. Running- start-blocked

Select the incorrect process mode


1. User
2. Privileged
3. Register
4. Kernel

PCB contains:
1. processor state
2. scheduling informa>on
3. process priority
4. All of the above

What is the currently most used thread model for computers?


1. Many to one
2. Many to many
3. One to one
4. None of the above

Which is the main func>on of the Process Control Block (PCB) ?


1. To duplicate processes
2. Each entry in table keeps informa>on about one process
3. To assign the memory space that a process can use
4. To assign a processor to a new process.

If in Round-Robin scheduling ‘q’ equals infinity, we could say that this would be the same as:
1. Shortest job first
2. First to come first to serve
3. Both are correct
4. None of the above

You might also like