Let f(x) be prints for a process with counter x: after fork, both parent and child print once and then continue with x−1, so f(x)=2(1+f(x−1)) with f(0)=0. f(1)=2, f(2)=6, f(3)=14.
More System Calls, Processes, Threads and IPC questions
GATE 2024 CS (CS2) Q25– Consider a process P running on a CPU. Which one or more of the following events will…
GATE 2023 CS Q22– Which one or more of the following need to be saved on a context switch from one thread…
GATE 2023 CS Q23– Which one or more of the following options guarantee that a computer system will…
GATE 2021 CS (CS1) Q24– Which of the following standard C library functions will always invoke a system call when…
GATE 2020 CS Q22– Consider the following statements about process state transitions for a system using…
GATE 2019 CS Q27– The following C program is executed on a Unix/Linux system: The total number of child…