Processes
Processes
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.
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.
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.
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.
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
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 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
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
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
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.
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
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
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
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.
PCB contains:
1. processor state
2. scheduling informa>on
3. process priority
4. All of the above
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