Question 51
MediumIn Unix-like systems, what is a signal?
- A.
A file permission
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Operating Systems
In Unix-like systems, what is a signal?
A file permission
A hardware cable
A type of thread
An asynchronous notification sent to a process about an event
Sign up free to see the answer and a step-by-step explanation.
What does a process's nice value affect in Linux?
Its scheduling priority
Its process ID
Its memory limit
Its file permissions
Sign up free to see the answer and a step-by-step explanation.
After fork(), what does the child process get?
Direct access to the parent's variables
An empty address space
The parent's PID
A copy of the parent's address space (often shared copy-on-write until either writes)
Sign up free to see the answer and a step-by-step explanation.
Why does an operating system keep a timer that interrupts the CPU at fixed intervals?
To cool the CPU
To show the time to the user
So that no process can keep the CPU forever and the OS regains control
To count disk blocks
Sign up free to see the answer and a step-by-step explanation.
How many times is "hello" printed by this program?
#include <stdio.h>
#include <unistd.h>
int main(void) {
fork();
fork();
fork();
printf("hello\n");
return 0;
}
Enter a number as the answer.
Sign up free to see the answer and a step-by-step explanation.
A process calls fork() 4 times in a row (every process continues to the next call). How many child processes are created in total?
8
15
4
16
Sign up free to see the answer and a step-by-step explanation.
Which of these instructions should be privileged? (Select all that apply.)
Setting the timer
Disabling interrupts
Reading the time of day
Changing the memory-management registers
Sign up free to see the answer and a step-by-step explanation.
How does a trap differ from a hardware interrupt?
A trap is caused by the running program (an error or a system call); an interrupt comes from a device
They are the same thing
A trap can only happen in kernel mode
A trap comes from a device; an interrupt comes from the program
Sign up free to see the answer and a step-by-step explanation.
What happens when a process successfully calls exec()?
The process ends and its parent continues
Its program is replaced by a new one, and the PID stays the same
The process is moved to another CPU
A new child process is created
Sign up free to see the answer and a step-by-step explanation.
What is a zombie process?
A process whose parent has died
A process stuck in an infinite loop
A process that uses too much memory
A process that has finished but whose entry stays in the process table until its parent calls wait()
Sign up free to see the answer and a step-by-step explanation.