Midterm Review Flashcards

1
Q

What is the primary goal of an operating system?
a) To manage hardware resources
b) To run applications
c) To provide a user interface
d) All of the above

A

d) All of the above

An operating system’s main goal is to manage hardware resources, run applications, and provide a user interface. It coordinates everything.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the kernel in the operating system?
a) The central processing unit (CPU)
b) The core component responsible for managing resources
c) The graphical user interface (GUI)
d) The compiler

A

b) The core component responsible for managing resources

The kernel is like the brain of the operating system, handling tasks like managing memory, CPU usage, and input/output.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is one restriction of a 32-bit kernel?
a) The maximum size of an individual process
b) The number of threads that can execute at once
c) The size of the cache.
d) The link to the DMA controller

A

a) The maximum size of an individual process

A 32-bit kernel can limit how big a single program can be, restricting its memory usage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is multiprogramming in operating systems?
a) Running multiple programs simultaneously
b) Running a single program on multiple computers
c) Running multiple instances of the same program
d) Running programs with multiple threads

A

a) Running multiple programs simultaneously

Multiprogramming means the OS can handle many tasks at once, like switching between different apps quickly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a process in an operating system?
a) A program in execution
b) A file stored on the hard disk
c) An input/output device
d) A type of memory

A

a) A program in execution

A process is like a running program, including all the stuff it needs to work properly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the difference between a process and a thread?
a) A process can share memory
b) A thread can share memory
c) A process can run multiple threads
d) A thread can run multiple processes

A

b) A thread can share memory

Threads are like mini-programs inside a bigger program, and they can share information easily.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is parallelism in operating systems?
a) The ability to execute multiple instructions simultaneously
b) The ability to switch between processes quickly
c) The ability to run multiple processes simultaneously on multiple processors
d) The ability to allocate memory resources efficiently

A

c) The ability to run multiple processes simultaneously on multiple processors

Parallelism lets the OS spread out tasks across multiple parts of the computer to get things done faster.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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

A

b) The ability of an operating system to handle multiple tasks simultaneously

Concurrency involved managing multiple tasks simultaneously to ensure that nothing is overlooked or left behind.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When processes communicate with one another, this is often done through the use of
______________
a) Shared memory
b) Semaphores
c) Morse code
d) Shared files

A

a) Shared memory

Because it allows them to directly exchange data fast and efficient.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a critical section in concurrent programming?
a) A section of code that must be executed atomically
b) A section of code that can be executed by multiple threads simultaneously
c) A section of code that is not important for program execution
d) A section of code that is executed only once

A

a) A section of code that must be executed atomically

A critical section is like a ‘do not disturb’ sign for code, ensuring it runs smoothly without interruptions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is synchronization in operating systems?
a) The process of coordinating the execution of multiple processes or threads
b) The process of transferring data between processes
c) The process of allocating memory to processes
d) The process of allocating CPU time to processes

A

a) The process of coordinating the execution of multiple processes or threads

Synchronization is about making sure that everyone is on the same page, so tasks don’t trip over each other.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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

A

b) A variable used to control access to a shared resource

Semaphore is used to control when different processes can use shared resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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

A

c) A tool used to synchronize access to a shared resource

A mutex is used to synchronize access in order to prevent chaos.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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

A

b) Mutexes can be used for mutual exclusion, while semaphores cannot

Mutexes are specialists in keeping things exclusive, while semaphores are more versatile, handling a range of coordination tasks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is concurrency in operating systems?
a) The ability to run multiple processes simultaneously
b) The ability to run multiple threads simultaneously
c) The ability to execute multiple instructions in parallel
d) The ability to switch between processes quickly

A

b) The ability to run multiple threads simultaneously

Concurrency means that OS can handle different tasks at the same time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the primary goal of concurrency in operating systems?
a) Maximising CPU utilisation
b) Minimising memory usage
c) Reducing program execution time
d) Improving system reliability

A

c) Reducing program execution time
Concurrency aims to make programs finish their tasks faster, by allowing different parts on the computer to work on multiple tasks.

17
Q

What is the difference between concurrency and parallelism?
a) Concurrency involves executing multiple tasks at the same time, while parallelism involves executing tasks sequentially.
b) Concurrency involves executing tasks sequentially, while parallelism involves executing tasks at the same time.
c) Concurrency and parallelism are synonymous terms.
d) Concurrency and parallelism both involve executing tasks simultaneously.

A

b) Concurrency involves executing tasks sequentially, while parallelism involves executing tasks the
Their main difference:
P - working together at the same time
C - managing different tasks each one at a time

18
Q

Which of the following is a common technique used to achieve parallelism in OS?
a)Multiprogramming
b) Preemptive scheduling
c) Thread pooling
d) Multitasking

A

c) Thread Pooling

By managing and reusing a pool of threads to execute multiple tasks in parallel.

19
Q

What is the purpose of a barrier in parallel computing?
a) To synchronize the execution of multiple threads or processes
b)To prevent deadlock
c) To allocate memory resources efficiently
d) To schedule tasks for execution

A

a) To synchronize the execution of multiple threads or processes

Ensures that all threads / processes reach a certain point in their execution before proceeding further.

20
Q

What is the purpose of a mutex in concurrent programming?
a) To prevent deadlocks
b) To ensure mutual exclusion and synchronise access to shared resources
c) To allocate memory resources to processes
d) To maximise CPU utilisation

A

b) To ensure mutual exclusion and synchronise access to shared resources

Ensures that only one thread can access a shared resource at a time, preventing conflicts.