1What is a process?
A program in execution, consisting of code, data, and resources
2What are the key characteristics of a process?
Owns memory space, isolated from others, managed by OS
3Which state means a process is being created?
New
4Which state means a process is waiting for a processor?
Ready
5Which state means process instructions are being executed?
Running
6Which state means a process is waiting for an event?
Waiting
7Which state means a process has finished execution?
Terminated
8What is Inter-Process Communication (IPC)?
Mechanisms that allow processes to communicate and synchronize actions
9Which IPC mechanism allows multiple processes to access the same memory space?
Shared Memory
10Which IPC mechanism lets processes send and receive messages through a queue?
Message Queues
11Which IPC mechanism passes data in a unidirectional flow between processes?
Pipes
12Which IPC mechanism is used for process communication over a network?
Sockets
13Which IPC mechanism sends simple notifications to processes?
Signals
14What is a thread?
The smallest unit of execution within a process
15What are thread characteristics?
Shares memory with other threads, has its own stack and registers, faster to create than processes
16How is memory handled between processes and threads?
Processes have separate memory, threads share memory
17How does creation speed differ between processes and threads?
Processes are slower to create, threads are faster
18How do processes communicate compared to threads?
Processes use IPC, threads communicate via shared memory
19Which has higher overhead, processes or threads?
Processes
20What is multithreading?
The ability of a CPU/core to execute multiple threads concurrently
21What are advantages of multithreading?
Improves performance, efficient CPU use, responsive applications
22Give example applications of multithreading.
Web servers, modern operating systems
23What is the purpose of synchronization?
To avoid race conditions and ensure data consistency
24What analogy explains mutexes?
A restroom with a single key
25What real application fits mutexes?
Preventing multiple threads from writing to a file simultaneously
26What analogy explains semaphores?
A parking lot with limited spots
27What real application fits semaphores?
Controlling access to limited database connections
28What analogy explains monitors?
A secretary managing meeting room access
29What real application fits monitors?
High-level synchronization abstraction with locks and condition variables
30What analogy explains locks?
Locking your personal locker
31What real application fits locks?
General mechanisms for mutual exclusion, like read/write locks
32What are user threads?
Threads managed by a user-level thread library
33Name examples of user thread libraries.
POSIX Pthreads, Windows threads, Java threads
34What are kernel threads?
Threads supported by the operating system kernel
35Name examples of systems supporting kernel threads.
Windows, Solaris, Linux, Tru64 UNIX, Mac OS X
36What is the many-to-one threading model?
Many user-level threads map to one kernel thread
37Give examples of many-to-one systems.
Solaris Green Threads, GNU Portable Threads
38What is the one-to-one threading model?
Each user thread maps to a kernel thread
39Give examples of one-to-one systems.
Windows, Linux, Solaris 9+
40What is the many-to-many threading model?
Many user threads mapped to many kernel threads
41Give examples of many-to-many systems.
Solaris pre-9, Windows with ThreadFiber
42What is the two-level threading model?
Like many-to-many, with OS creating sufficient kernel threads
43Give examples of two-level model systems.
Solaris pre-9, Windows with ThreadFiber
44What do thread libraries provide?
APIs for creating and managing threads
45What are ways thread libraries are implemented?
Entirely in user space, or as kernel-supported libraries
46What are benefits of using threads?
Improved performance, efficient resources, simpler concurrent program structure
47What are challenges of using threads?
Complex synchronization, avoiding deadlocks, harder debugging