In the UNIX operating system, when a process creates a child process using the fork() system call, which of the following is genuinely shared between the parent and child process, rather than being copied?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: C. Shared memory segments
Explanation
fork() gives the child a logical duplicate of the parent's address space: the heap and stack are process-private, implemented with copy-on-write so each process ends up with its own independent pages the moment either one writes to them — they are copied, not shared. Any System V/POSIX shared-memory segment the parent had attached (e.g. via shmat() or mmap(MAP_SHARED)), however, continues to map onto the exact same physical memory in both processes after the fork, so writes by either process are immediately visible to the other. Hence it is the shared memory segments that are truly shared, option (iii), while heap and stack remain independent in each process.More Computer System Architecture questions
- A system has 12 instances of a resource R shared among four processes. The maximum need and current allocation of each process are: Process…
- Match List I with List II
- The write operation in I/O operation does the following-
- Which of the following gates do not give output 1 when both the inputs are 0 - A. NAND gate B. NOR gate C. X-OR gate D. X-NOR gate
- Which of the following statements are true ? A. In the write-through policy, only the cache is updated B. In the write-back policy, both ca…
- The right sequence of suboperations that are performed in arithmetic pipeline is- A. Align the mantissas B. Add or subtract the mantissas C…