preview

Nt1310 Unit 7 Homework

Decent Essays

3.1) Output is 5 because in the child process value of the variable “value” is a copy of value(Unix assigns parent’s address space of the variable and gives it to child) and when parent process gets back the control, value will still be 5.
3.8) Short term scheduler or CPU scheduler: selects a process from the processes (that are in memory) that are ready to execute and allocates the CPU to it.
Medium term scheduler: It is an intermediate level of scheduling where in process is removed from memory (temporarily) to reduce the degree of multi programming and can be re introduced into memory later and execution of the process can be continued from where it is left off.
Long term scheduler: It will be invoked only when a process leaves the system …show more content…

C) mutex lock is better if the thread is put to sleep while holding the lock because in case of spinlock the thread will always try locking a spinlock if it is not successful which will take lot of CPU time and resources where as in case of mutex lock , it will allow to sleep during which other thread can run.
6.2) Preemptive scheduling allows a process to be invoked/disturbed in the middle of its execution by taking the CPU and assigning it to another process which is in queue where as in case of NonPreemptive scheduling, process will give up on CPU only when the current process is executed and finished.
6.10) I/O-bound projects have the property of performing just a little measure of computation before performing I/O. Such projects regularly don't use up their whole CPU quantum. Whereas, in case of CPU-bound projects, they utilize their whole quantum without performing any blocking I/O operations. Subsequently, one could greatly improve the situation utilization of the computer’s assets by giving higher priority to I/O-bound projects and permit them to execute in front of the CPU-bound

Get Access