CS FundamentalsVery hardGATE CS
Lottery scheduling gives process A 30 tickets, B 20 and C 50. Over many scheduling decisions, what fraction of the time does B run, and what happens to that fraction if C blocks for a long I/O?
- A. 20%, unchanged while C is blocked
- B. 33%, rising to 50%
- C. 20%, falling to 10% while C is blocked
- D. 20%, rising to 40% while C is blocked
Correct answer: D. 20%, rising to 40% while C is blocked
B holds 20 of 100 tickets. While C is not runnable only A's 30 and B's 20 compete, so B wins 20/50 = 40% of the draws.
More Operating Systems questions
- In real-time scheduling, three periodic tasks have (execution time, period) = (1, 4), (2, 6), (1, 8), with deadline = period. Which…
- Two periodic tasks: T1 (execution 2, period 5) and T2 (execution 4, period 7), deadlines equal to periods. Which statement is correct?
- Priority inversion: low-priority L holds a mutex needed by high-priority H, and medium-priority M (which does not need the mutex) keeps…
- Which property distinguishes a mutex from a binary semaphore in most implementations?
- A spinlock is held for about 50 ns on average, and a context switch costs about 5 µs. On a multicore machine, which is better for a thread…
- compareandswap(&v, expected, new) atomically sets v = new only if v == expected and returns the old value. A lock-free increment is…