Question 1
What is the primary function of the exec() system call in Unix-like operating systems?
The exec() family of functions replaces the current process image with a new process image loaded from an executable file.
What is the primary function of the exec() system call in Unix-like operating systems?
The exec() family of functions replaces the current process image with a new process image loaded from an executable file.
In Unix, which signal is sent to a process to request graceful termination?
SIGTERM (signal 15) requests process termination allowing cleanup, whereas SIGKILL (signal 9) forces immediate termination.
What happens to a child process if its parent process terminates before calling wait()?
When a parent process terminates, its surviving child processes become orphans and are adopted by process ID 1 (init/systemd).
Which state transition occurs when an IO operation requested by a running process completes?
When an I/O operation finishes, an interrupt moves the waiting process from the Blocked/Waiting state back to the Ready queue.
What is the main advantage of threads over processes?
Threads within the same process share code, data, and OS resources, making context switching faster than between separate processes.