unit 2 Flashcards

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

What is a process?

A

A program in execution; process execution must progress in sequential fashion.

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

What are the multiple parts of a process?

A
  • Program code (text section)
  • Current activity (program counter, processor registers)
  • Stack (temporary data, function parameters, return addresses, local variables)
  • Data section (global variables)
  • Heap (dynamically allocated memory during runtime)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between a program and a process?

A

A program is a passive entity stored on disk (executable file), while a process is an active entity that is loaded into memory.

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

What are the five states a process can be in?

A
  • New
  • Running
  • Waiting
  • Ready
  • Terminated
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a Process Control Block (PCB)?

A

Information associated with each process, including process state, program counter, CPU registers, scheduling information, memory-management information, accounting information, and I/O status information.

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

What is the role of the short-term scheduler?

A

Selects which process should be executed next and allocates CPU.

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

What is the difference between I/O-bound and CPU-bound processes?

A
  • I/O-bound process: spends more time doing I/O than computations, many short CPU bursts
  • CPU-bound process: spends more time doing computations, few very long CPU bursts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What happens during a context switch?

A

The system saves the state of the old process and loads the saved state for the new process.

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

What are the two main operations provided for interprocess communication (IPC)?

A
  • send(message)
  • receive(message)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the two models of IPC?

A
  • Shared memory
  • Message passing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a socket in the context of client-server communication?

A

An endpoint for communication, defined as a concatenation of IP address and port.

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

What is remote procedure call (RPC)?

A

Abstraction for procedure calls between processes on networked systems, using ports for service differentiation.

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

What are the two types of pipes used for interprocess communication?

A
  • Ordinary pipes
  • Named pipes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the benefits of multithreading in modern applications?

A
  • Responsiveness
  • Resource sharing
  • Economy
  • Scalability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the difference between concurrency and parallelism?

A
  • Concurrency: supports more than one task making progress
  • Parallelism: implies a system can perform more than one task simultaneously
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are the four multithreading models?

A
  • Many-to-One
  • One-to-One
  • Many-to-Many
  • Two-Level
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is a thread library?

A

Provides an API for creating and managing threads.

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

What is the purpose of a thread pool?

A

Creates a number of threads that await work, allowing for faster servicing of requests.

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

What is Grand Central Dispatch?

A

Apple technology for managing threading in Mac OS X and iOS, allowing identification of parallel sections.

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

What are the two types of threads in the context of thread management?

A
  • User threads
  • Kernel threads
22
Q

What is a signal handler?

A

Used to process signals generated by particular events in UNIX systems.

23
Q

Fill in the blank: A process executes the last statement and then asks the operating system to delete it using the _______ system call.

24
Q

True or False: A child process can exist if its parent process has terminated in all operating systems.

25
What are the major issues in shared memory IPC?
Providing mechanisms for user processes to synchronize their actions when accessing shared memory.
26
What is the role of the long-term scheduler?
Selects which processes should be brought into the ready queue.
27
What is a signal in the context of process management?
A signal is generated by a particular event.
28
How is a signal delivered to a process?
Signal is delivered to a process.
29
What are the two types of signal handlers?
* Default handler * User-defined handler
30
What does the kernel do when handling a signal?
The kernel runs the default handler.
31
What can a user-defined signal handler do?
Override the default handler.
32
Where is a signal delivered for single-threaded processes?
To the process.
33
How can a signal be delivered in multi-threaded processes?
* To the thread to which the signal applies * To every thread in the process * To certain threads in the process * Assign a specific thread to receive all signals for the process
34
What does thread cancellation mean?
Terminating a thread before it has finished.
35
What is the target thread in thread cancellation?
The thread to be canceled.
36
What are the two general approaches to thread cancellation?
* Asynchronous cancellation * Deferred cancellation
37
What is asynchronous cancellation?
Terminates the target thread immediately.
38
What is deferred cancellation?
Allows the target thread to periodically check if it should be cancelled.
39
What do both M:M and Two-level models require?
Communication to maintain the appropriate number of kernel threads allocated to the application.
40
What is a lightweight process (LWP)?
An intermediate data structure between user and kernel threads.
41
What does an LWP appear to be?
A virtual processor on which a process can schedule user threads to run.
42
How many LWPs should be created?
Scheduler activations provide upcalls.
43
What is the function of upcalls?
A communication mechanism from the kernel to the upcall handler in the thread library.
44
What does the communication via upcalls allow an application to do?
Maintain the correct number of kernel threads.
45
What is the primary API for Windows operating systems?
Windows API.
46
What kind of mapping does Windows implement for threads?
One-to-one mapping, kernel-level.
47
What are the components of a Windows thread?
* A thread id * Register set representing state of processor * Separate user and kernel stacks * Private data storage area
48
What is referred to as the context of the thread?
The register set, stacks, and private storage area.
49
What does Linux refer to threads as?
Tasks.
50
How is thread creation done in Linux?
Through the clone() system call.
51
What does the clone() system call allow?
A child task to share the address space of the parent task.
52
What controls the behavior of the clone() system call?
Flags.