CS FundamentalsHardGATE CS · Amazon/Microsoft SDE MCQ
Under Linux CFS, two CPU-bound tasks share one CPU: one at nice 0 (weight 1024) and one at nice 5 (weight 335). About what share of CPU does the nice-0 task get?
- A. About 67%
- B. About 75%
- C. About 50%
- D. About 83%
Correct answer: B. About 75%
CFS divides time in proportion to weights: 1024 / (1024 + 335) ≈ 0.753. Each nice step changes the weight by about 1.25x, so five steps give roughly a 3:1 split, not a fixed slice per nice level.
More Operating Systems questions
- A system's average process size is s = 1 MB and each page-table entry takes e = 8 bytes. Balancing page-table overhead (s·e / p) against…
- What does this program print? (Assume fork() succeeds and the exec of echo succeeds.) c int main() { fork(); execlp("echo", "echo", "hi"…
- In a traditional Unix file system (such as ext2/ext4 without very large directories), directory /d contains 3 subdirectories and 5 regular…
- A process with umask 027 creates a regular file requesting mode 0666 and a directory requesting mode 0777. What permissions do they get?
- A process writes to a pipe whose read end has been closed by every process. What happens by default?
- A device raises 10,000 interrupts per second, and each interrupt costs 50 µs of CPU time to enter, service and return. What fraction of…