Operating systems miscellaneous
- Which of the following is/are shared by all the threads in a process?
I. Program counter
II. Stack
III. Address space
IV. Registers
-
View Hint View Answer Discuss in Forum
The thread is a light weight process and all the threads in a process has share address space but other entities like, stack, PC, registers are not shared and every thread will have its own.
So, option (b) is correct.Correct Option: B
The thread is a light weight process and all the threads in a process has share address space but other entities like, stack, PC, registers are not shared and every thread will have its own.
So, option (b) is correct.
- A process executes the code
fork ();
fork ();
fork ();
The total number of child processes created is
-
View Hint View Answer Discuss in Forum
A process executes the code and works as follows:
The number of child processes created = 2n – 1 = 23 – 1 = 8 – 1 = 7 where, n = 3 ∵ 3 fork () are executing.Correct Option: C
A process executes the code and works as follows:
The number of child processes created = 2n – 1 = 23 – 1 = 8 – 1 = 7 where, n = 3 ∵ 3 fork () are executing.
- A thread is usually defined as a ‘light weight process’ because an Operating System (OS) maintains smaller data structures for a thread than for a process. In relation to this, which of the following is true?
-
View Hint View Answer Discuss in Forum
Threads are called 'light weight process' because they only need storage for stack and registers. They don't need separate space for other things like code segment, global data, etc.
Correct Option: A
Threads are called 'light weight process' because they only need storage for stack and registers. They don't need separate space for other things like code segment, global data, etc.
- Consider a disk pack with a seek time of 4 milliseconds and rotational speed of 10000 Rotations Per Minute (RPM). It has 60 sectors per track and each sector can store 512 bytes of data. Consider a file stored in the disk. The file contains 2000 sectors. Assume that every sector access necessitates a seek, and the average rotational latency for accessing each sector is half of the time for one complete rotation. The total time (in milliseconds) needed to read the entire file is _______.
-
View Hint View Answer Discuss in Forum
Given that , Seek time = 4ms
60s → 10000 rotations
60s → 10000 rotations60 = 6 ms ← 1 rotation time 10000 ∴ Rotational Latency = 1 × 6 ms = 3 ms 2
1 track → 600 sectors
6ms ← 600 sectors (1 rotation means 600 sectors or 1 track)1 sector → 6ms = 0.01 ms 600
2000 sector → 2000 (0.01) = 20 ms
∴ Total time needed to read the entire tile is = 2000 (4 + 3) + 20
= 8000 + 6000 + 20 = 14020 msCorrect Option: C
Given that , Seek time = 4ms
60s → 10000 rotations
60s → 10000 rotations60 = 6 ms ← 1 rotation time 10000 ∴ Rotational Latency = 1 × 6 ms = 3 ms 2
1 track → 600 sectors
6ms ← 600 sectors (1 rotation means 600 sectors or 1 track)1 sector → 6ms = 0.01 ms 600
2000 sector → 2000 (0.01) = 20 ms
∴ Total time needed to read the entire tile is = 2000 (4 + 3) + 20
= 8000 + 6000 + 20 = 14020 ms
- Which one of the following is FALSE ?
-
View Hint View Answer Discuss in Forum
(a) is correct as user Perel threads are managed without kernel support.
(b) In many one model, it one thread makes a blocking system call, the entire process is blocked so all its threads are also blocked.
(c) User Level threads are faster to create & manage than kernel threads as no intervention from kernel is required, so the context switch in them is also faster.
(d) As all threads share code & data including kernel level threads, so this option is ‘FALSE’.Correct Option: D
(a) is correct as user Perel threads are managed without kernel support.
(b) In many one model, it one thread makes a blocking system call, the entire process is blocked so all its threads are also blocked.
(c) User Level threads are faster to create & manage than kernel threads as no intervention from kernel is required, so the context switch in them is also faster.
(d) As all threads share code & data including kernel level threads, so this option is ‘FALSE’.