Multiple Choice Questions Flashcards
What is the primary benefit of virtual memory in computer systems?
a. It allows for the execution of programs without requiring memory.
b. It separates the developer’s logical memory from the physical memory, enabling a larger virtual memory to be available than the physical memory.
c. It enhances the speed of the CPU by increasing cache size.
d. It provides unlimited physical memory for all running applications.
b. It separates the developer’s logical memory from the physical memory, enabling a larger virtual memory to be available than the physical memory.
Virtual memory allows programs to use more memory than physically available by using disk storage to extend the memory space.
What is a physical address in the context of computer memory?
a. A location in physical memory where data is stored, as opposed to a virtual address.
b. An address used to locate data in a network.
c. An address used by the CPU cache to store frequently accessed data.
d. An abstract address used by programmers to manage memory efficiently.
a. A location in physical memory where data is stored, as opposed to a virtual address.
A physical address refers to an actual location in RAM, contrasting with virtual addresses used by programs.
What is paging in the context of computer memory management?
a. Increases CPU speed.
b. Allocates continuous memory blocks.
c. Eliminates the need for physical memory.
d. Divides memory into fixed-size pages.
d. Divides memory into fixed-size pages.
Paging breaks memory into fixed-size blocks, simplifying memory management.
What happens when a thread requests resources that are not available?
a. The thread is terminated.
b. The thread continues running.
c. The thread enters a waiting state.
d. The thread is restarted.
c. The thread enters a waiting state.
If a thread requests unavailable resources, it typically waits until the resources become available.
What may happen if a system does not use deadlock-prevention or deadlock-avoidance algorithms?
a. The system will run faster.
b. A deadlock situation may arise.
c. The system will avoid deadlocks.
d. Processes will run sequentially.
b. A deadlock situation may arise.
Without mechanisms to prevent or avoid deadlocks, processes may end up in a state where they cannot proceed because each is waiting for resources held by the other.
Which scheduling algorithm may cause starvation?
a. First-Come, First-Served (FCFS)
b. Shortest Job Next (SJN)
c. Round Robin (RR)
d. Priority Scheduling
d. Priority Scheduling
In priority scheduling, low-priority processes may starve if higher-priority processes continually arrive and get processed first.
Which of the following is true about paging?
a. It eliminates the need for a page table.
b. It can cause external fragmentation.
c. It uses fixed-size blocks of memory.
d. It uses variable-size blocks of memory.
c. It uses fixed-size blocks of memory.
Paging divides memory into fixed-size pages, reducing fragmentation.
What is a critical section in concurrent programming?
a. A section of code that must be executed by a single thread at a time
b. A section of code that can be executed by multiple threads simultaneously
c. A section of code that handles errors
d. A section of code that initializes resources
a. A section of code that must be executed by a single thread at a time
While multiple processes are executed concurrently, the critical section is protected so that only one thread can execute it at a time.
In which memory allocation strategy does the system allocate the first hole that is big enough?
a. First fit
b. Best fit
c. Worst fit
d. Next fit
a. First fit
First fit allocates the first block of memory that is large enough to satisfy the request, which can lead to efficient use of memory but can also cause fragmentation.
What is concurrency?
a. The ability of a system to handle requests sequentially
b. The ability of an operating system to handle multiple tasks simultaneously
c. The capability of an operating system to update itself
d. The process by which user rights are managed
b. The ability of an operating system to handle multiple tasks simultaneously
Concurrency refers to the system’s ability to handle multiple operations or tasks at the same time.
What is a semaphore in operating systems?
a. A flag used to indicate the status of a process
b. A variable used to control access to a shared resource
c. A data structure used to store process information
d. A type of scheduling algorithm
b. A variable used to control access to a shared resource
Semaphores are used as synchronization mechanisms, helping to manage access to shared resources in a concurrent environment.
What is a mutex in operating systems?
a. A tool used for inter-process communication
b. A tool used to prevent deadlocks
c. A tool used to synchronize access to a shared resource
d. A tool used to allocate memory to processes
c. A tool used to synchronize access to a shared resource
Mutexes ensure that only one thread can access a resource at a time, preventing race conditions.
What is the purpose of a mutex in concurrent programming?
a. To prevent deadlocks
b. To ensure mutual exclusion and synchronize access to shared resources
c. To allocate memory resources to processes
d. To maximize CPU utilization
b. To ensure mutual exclusion and synchronize access to shared resources
The primary purpose of a mutex is to ensure that only one thread can access a critical section or shared resource at any time.
What is the difference between a semaphore and a mutex?
a. Semaphores can be used for mutual exclusion, while mutexes cannot
b. Mutexes can be used for mutual exclusion, while semaphores cannot
c. Mutexes can be used to control access to multiple resources, while semaphores cannot
d. Semaphores can be used to control access to multiple resources, while mutexes cannot
d. Semaphores can be used to control access to multiple resources, while mutexes cannot
Semaphores can be used for signaling and can control access to multiple instances of a resource, while mutexes are binary and typically used for mutual exclusion.
Which component is essential for implementing virtual memory?
a. Page table
b. File system
c. Network interface card
d. Scheduler
a. Page table
The key component in translating virtual addresses to physical addresses in virtual memory.