0% found this document useful (0 votes)
17 views6 pages

Provi Mi

Uploaded by

albjoridollani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views6 pages

Provi Mi

Uploaded by

albjoridollani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Provimi:

1. Explain the difference between the processes and threads? List some of them.

A process is an instance of a program in execution, isolated from other processes, with its own
memory space. A thread, on the other hand, is a subset of a process. Threads within the same
process share the same memory space, allowing for more efficient communication between threads
than between processes.

2. Draw and describe the states in a lifetime of a process?

2. A process typically goes through the following states:


 New: The process is being created.
 Ready: The process is waiting to be assigned to a processor.
 Running: Instructions are being executed.
 Waiting: The process is waiting for some event to occur.
 Terminated: The process has finished execution.

3. What are the benefits of multithreading?

Multithreading can help to make a program more responsive, especially for tasks waiting for external
resources or which need to perform slow I/O operations. It can also make a program more efficient
by allowing multiple operations to overlap in time.

4. Suppose we have a program that consists of two parts: Part A which takes up to 80% of
execution time. Part B which takes up to 20% of the remaining time. Part A can be parallelized,
but part B can not . If we run this program on a computer with 4 processors, how much speedup
can be expected to achieve by using Amdahl's Law ?

Amdahl’s law is used to find the maximum improvement possible by using parallel processing. If 80%
of the program can be parallelized, the fraction that is sequential is 20%. Therefore, the speedup is
1 / (0.20 + 0.80/4) = 2.5 times.

1. 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

2. 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

3. 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

4. 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

5. 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
6. 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

7. 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

8. 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

9. What is the primary goal of concurrency in operating systems?

a) Maximizing CPU utilization

b) Minimizing memory usage

c) Reducing program execution time

d) Improving system reliability


10.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

11. 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.

12.Which of the following is a common technique used to achieve parallelism in operating


systems?

a) Multiprogramming

b) Preemptive scheduling

c) Thread pooling

d) Multitasking

13.What is the purpose of a barrier in parallel computing?

a) To synchronise the execution of multiple threads or processes

b) To prevent deadlock

c) To allocate memory resources efficiently


d) To schedule tasks for execution

14.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

15.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

16.What is synchronisation 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

17.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


18.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 synchronise access to a shared resource

d) A tool used to allocate memory to processes

19.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

20.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

You might also like