Process Management in OS Flashcards

1
Q

Process

A

A program in execution: A process is essentially a program in the midst of execution. Processes are the active content within a computer system, starting from when the program is opened (or executed) until it is closed.

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

Batch System

A

Processes are referred to as “jobs.” This terminology is reminiscent of older computing systems where tasks were submitted in batches.

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

Time-shared systems

A

Processes are often referred to as “user programs” or “tasks.” This reflects the multi-user, multitasking nature of such systems where multiple processes may be executed concurrently.

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

Items of a process

A
  • Program counter: Holds the address of the next instruction to be executed, thus guiding the sequential flow of control.
  • Stack: Used for storing temporary data like function parameters, return addresses, and local variables.
  • Data section: Contains the global and static variables used by the program.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Process State

A
  1. New: The process is being created.
  2. Running: The process is currently executing instructions.
  3. Waiting: The process is paused, waiting for an event to occur.
  4. Ready: The process is ready to run and waiting for processor allocation.
  5. Terminated: The process has completed execution and is exiting.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Process Control Block

A
  • Process State: The current status of the process (e.g., New, Running, Waiting, Ready, Terminated).
  • Program Counter: Holds the address of the next instruction for the process to execute.
  • CPU Registers: Contains the process’s current register values when it is not running.
  • CPU Scheduling Information: Includes priority information and other data necessary for scheduling the process.
  • Memory-Management Information: Details about the process’s allocated memory, including base and limit registers.
  • Accounting Information: Information tracking the use of processor time and other resources by the process.
  • I/O Status Information: Lists the I/O devices allocated to the process and a list of open files.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Process Scheduling Queues

A
  • Job Queue: The set of all processes in the system.
  • Ready Queue: The set of all processes residing in main memory that are ready and waiting to execute.
  • Device Queues: Sets of processes waiting for an I/O device.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Short-term scheduler

A
  • Selects which process to execute next and allocates CPU.
  • Invoked very frequently to maintain efficient processor use.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Long-term scheduler

A
  • Selects processes to bring into the ready queue.
  • Controls the degree of multiprogramming.
  • Balances the mix of CPU-bound and I/O-bound processes.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Process Creation

A
  • Parent Process Creates Children: Parent processes can create child processes, forming a tree of processes.
  • Resource Sharing: Determines how resources are shared between parent and child processes.
  • Execution: Parent and children can either execute concurrently or the parent can wait for the children to terminate.
  • Address Space:
    The child process starts as a duplicate of the parent (same program and data). The child can load a new program into its address space.
  • UNIX System Calls: fork to create a new process, exec to load a new program into the process’s address space.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Process termination - exit

A
  • The process completes its execution and asks the OS to delete it.
  • The parent process can receive output data from the child through the wait system call.
  • The operating system deallocates the resources of the process.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Process Termination - abort

A
  • The child has exceeded its allocated resources.
  • The task assigned to the child is no longer required.
  • The parent is exiting, and the OS does not allow the child to continue independently.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Advantages of Process Cooperation

A
  • Information sharing
  • Computation speed-up
  • Modularity
  • Convenience
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Direct Communicaton

A
  • Links are established automatically.
  • A link is associated with exactly one pair of processes.
  • Between each pair, there exists exactly one link.
  • Links are usually bi-directional, though they can be unidirectional.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Indirect Communication

A
  • A link is established only if processes share a common mailbox.
  • A link can be associated with many processes.
  • Each pair of processes can share several links.
  • Links can be unidirectional or bi-directional.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Blocking (Synchronous) Message Passing

A

The sending/receiving processes wait until the other side is ready.

17
Q

Non-blocking (Asynchronous) Message Passing

A

The sending/receiving processes do not wait for each other.

18
Q

Buffering - Zero Capacity

A

No messages are buffered; direct handoff.

19
Q

Buffering - Bounded Capcacity

A

A fixed number of messages can be buffered.

20
Q

Buffering - Unbounded Capacity

A

An unlimited number of messages can be buffered.

21
Q

Sockets

A

Endpoints for communication, identified by an IP address and a port number (e.g., 161.25.19.8:1625).

22
Q

Remote Procedure Calls (RPCs)

A

Enable procedure calls between distributed processes, with structured messages and stubs acting as client-side and server-side proxies.

23
Q

Remote Method Invocation (RMI)

A

A Java mechanism similar to RPCs but specifically for Java objects and methods.

24
Q

Ordinary Pipes

A
  • Producer/Consumer
  • Unidirectional: Prod -> Consumer
  • Parent -> Child Process
  • Half-Duplex
  • Same machine
25
Q

Named Pipes

A
  • Bidirectional
  • No relationship
  • Continue
26
Q

Full Duplex

A

Data can travel in both directions at the same time

27
Q

Half Duplex

A

Data can travel only one way at a time

28
Q

Benefits of Threads

A
  • Responsiveness: Enhances system responsiveness by allowing tasks to run concurrently
    or in parallel.
  • Resource Sharing: Enables efficient sharing of resources among multiple tasks or processes.
  • Economy: Improves system economy through task multiplexing and reducing overhead.
  • Utilization of MP Architectures: Boosts performance by leveraging multi-processor (MP) architectures for parallel task execution.
29
Q

Many-to-One Model

A

Multiple user-level threads map to one kernel thread.
- Solaris Green Threads: An implementation of threads that maps multiple user- level threads to a single kernel thread.
- GNU Portable Threads: A user-level thread library where multiple threads are managed by a single process without kernel-level context switching.

30
Q

One-to-One Model

A

Each user-level thread maps to a kernel thread.
- Windows NT/XP/2000: Each user-level thread corresponds to a single kernel thread, allowing better concurrency on multiprocessor systems.
- Linux: Implements a one-to-one threading model where each user thread is associated with a distinct kernel thread.
- Solaris 9 and later: Shifted to a one-to-one model to improve performance and scalability on multiprocessor systems.

31
Q

Many-to-Many Model

A
  • Solaris prior to version 9: Allowed mapping many user-level threads to many kernel threads, providing flexibility in how threads were managed.
  • Windows NT/2000 with the ThreadFiber package: Provided the ability to use a many-to-many threading model through additional libraries, offering a hybrid approach between user and kernel threads.
32
Q

Two-level Model

A
  • IRIX
  • HU-UX
  • Tru-64 UNIX Solaris-8 and earlier
33
Q

Threading issues

A
  • System Calls: Interactions with fork() and exec() can affect threads differently. Thread - Cancellation: Terminating a thread before it has completed.
  • Signal Handling: Managing UNIX signals within multithreaded applications. Thread
  • Pools: Using a pool of pre-created threads to handle tasks.
  • Thread-Specific Data: Allowing individual threads to have their own copies of data.
  • Scheduler Activations: Communication between the kernel and thread library to manage kernel threads.
34
Q

Thread-Pools

A
  • Concept: Create a number of threads in a pool to wait for and perform work.
  • Advantages: Slight performance improvement and the ability to limit the number of concurrent threads in an application.
35
Q

Signal Handling

A
  • To the thread that caused the signal.
  • To every thread in the process.
  • To specific threads in the process.
  • To a designated thread handling all signals for the process.
36
Q

Thread Cancellation

A
  • Asynchronous Cancellation: Terminates the target thread immediately.
  • Deferred Cancellation: The thread periodically checks if it should terminate, allowing for a safer cleanup.
37
Q

Thread-Specific Data

A

Allows each thread to maintain its own set of data, beneficial when the thread creation process is outside the programmer’s control.

38
Q
A