🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

What is a process in the context of opera0ng systems? a) A sec0on of the hard drive storing user data. b) An instance of a program running. c) The act of compiling a program. d) The primary memory or RAM of a computer. Correct Answer: b) An instance of a program running. Explana0on: A process is an...

What is a process in the context of opera0ng systems? a) A sec0on of the hard drive storing user data. b) An instance of a program running. c) The act of compiling a program. d) The primary memory or RAM of a computer. Correct Answer: b) An instance of a program running. Explana0on: A process is an ac0ve en0ty, represen0ng a program in execu0on, with its code loaded into memory. Which system call in Linux is used for crea0ng a new process? a) exec() b) fork() c) wait() d) pipe() Correct Answer: b) fork() Explana0on: The fork() system call is used to create a new process, which becomes the child process of the caller. What is the purpose of the exec() family of func0ons in process management? a) To duplicate an exis0ng process. b) To wait for a process to change its state. c) To terminate a process. d) To replace the process memory space with a new program. Correct Answer: d) To replace the process memory space with a new program. Explana0on: The exec() func0ons are used aHer fork() to replace the current process's memory space with a new program's code. In Linux, what happens to a child process that has terminated, but the parent process has not yet called wait()? a) It becomes an orphan process. b) It con0nues to run. c) It becomes a zombie process. d) It is immediately removed from the system. Correct Answer: c) It becomes a zombie process. Explana0on: A terminated child process whose parent has not called wait() is known as a zombie process. Which IPC (Inter-Process Communica0on) mechanism allows for bidirec0onal communica0on without the need for a parent-child rela0onship? a) Shared memory b) Pipes c) FIFO (named pipes) d) Message queues Correct Answer: c) FIFO (named pipes) Explana0on: FIFOs, also known as named pipes, allow for bidirec0onal communica0on and do not require a parent-child rela0onship between processes. What is a PCB (Process Control Block) and its purpose? a) A protocol for controlling peripheral devices. b) A data structure used to store the informa0on about a process. c) A library for process communica0on. d) The sec0on of the kernel responsible for process management. Correct Answer: b) A data structure used to store the informa0on about a process. Explana0on: The Process Control Block is a crucial data structure in the opera0ng system that contains process-related informa0on, such as its state, process ID, and other aTributes. In the context of child processes in Linux, what is the significance of the PID value 0? a) It indicates the PID of the init process. b) It represents the parent process ID. c) It is the PID assigned to the child process by the fork() system call. d) It signifies that the process making the call is the child process. Correct Answer: d) It signifies that the process making the call is the child process. Explana0on: When fork() is called, it returns twice: once with a value of 0 to the child process, indica0ng that it is the child, and once with the child's PID to the parent. What is a pipe in Linux, and how does it func0on? a) A hardware interface for I/O opera0ons. b) A soHware mechanism for memory management. c) A one-way communica0on channel between processes. d) A system call for crea0ng new threads. Correct Answer: c) A one-way communica0on channel between processes. Explana0on: A pipe is an IPC mechanism that allows one-way communica0on between a parent and a child process. What is the purpose of POSIX IPC? a) To facilitate the crea0on of independent processes. b) To provide a set of standards for inter-process communica0on. c) To define the standards for internal process scheduling. d) To establish network communica0on protocols. Correct Answer: b) To provide a set of standards for inter-process communica0on. Explana0on: POSIX IPC stands for Portable Opera0ng System Interface for inter-process communica0on, which provides a standard set of interfaces for processes to exchange data and signals. How do POSIX message queues differ from pipes? a) Message queues can only be used for communica0on between threads, not processes. b) Message queues allow for priority-based messaging. c) Message queues are slower than pipes. d) Message queues do not allow concurrent access. Correct Answer: b) Message queues allow for priority-based messaging. Explana0on: Unlike pipes, POSIX message queues allow messages to be sent and received with an associated priority, which can affect the order in which messages are received.

Use Quizgecko on...
Browser
Browser