COE128 Exam - 2 Flashcards
A program in execution
Process
Is the unit of execution within a process
Thread
As a process executes, _________.
it changes state
Defined in part by the current activity of that process.
The state of process
The process is being created
New
Instructions are being executed
Running
The process is waiting for some even to occur ( such as an I/O completion or reception of a signal).
Waiting
The process is waiting to be assigned to a processor
Ready
The process has finished execution
Terminated
Each process is represented in the OS by a _________________ - also called a _______________.
Process Control Block, Task Control Block
The state may be new, ready, running, waiting, halted, and so on.
Process State
Indicated the address of the next instruction to be executed for this process.
Program Counter
Tells us the registers that are being used by a particular process.
CPU Registers
This information includes a process priority, pointers, to scheduling queues, and any other scheduling parameters.
CPU-Scheduling Information
This information may include such information as the value of the base and limit registered, the page tables, or the segment table, depending on the memory system used by the operating system.
Memory-Management Information
This information includes the amount of CPU and real time used, time limits, account numbers, job or process numbers, and so on.
Accounting Information
This information includes the list of I/O devices allocated to the process, a list of open files, and so on.
I/O Status Information
The objective of _____________ is to have some process running at all times, to maximize CPU utlization.
Multiprogramming
The objective of ____________ is to switch the CPU among processes so frequently that users can interact users can interact with each program while it is running.
Time Sharing
Selects an available process (possibly from a set of several available processes) for program execution on the CPU.
Process Scheduler
For a ____________, there will never be more than one running process.
Single-Processor System
If there are ___________, the rest will have to wait until the CPU is free and can be rescheduled.
more processes
Set of all the processes in the system.
Job Queue
Set of all processes residing in main memory, ready and waiting to execute.
Ready Queue
Set of processes waiting for an I/O device.
Device Queue
________ causes the OS to change a CPU from its current task and to run a _________.
Interrupts, kernel routine
When a interrupt occurs, the system needs to save the current context of the process running on the CPU. So that it can restore that context when its process is done, essentially ____________.
Suspending the process and then resuming it
It is represented in the PCB (Process Control Block) of the process.
Context
Switching the CPU to another process requires performing a state save of the current process and a state restore of a different process.
Context Switch
_____________ is pure overhead, because the system does no useful work while switching.
Context-Switch Time
Speed varies from machine to machine depending on:
- Memory Speed
- Number of registers that must be copied.
- Existence of special instructions.
A process may create several new processes, via a _____________, during the course of execution.
create-process system call
The creating process is called a _________.
Parent Process
The new processes are called the ___________.
Children of that process
Each of these new processes may in turn create other processes, forming a ___________.
Tree of Processes
Most OS identity process according to a unique __________ which is typically an integer number.
Process identifier (PID)
When a process creates a new process, two (2) possibilities exist for execution:
- The parent continues to execute concurrently with its children.
- The parent waits until some of all its children have terminated.
There are two (2) possibilities for the address space of the new process:
- The child process is a duplicate of the parent process(it has the same program and data as the parent).
- The child process has a new program loaded into it.
A process terminates when it finishes executing its final statement and asks the OS to delete it by using the _____________.
exit() system call
The process may return a _________ to its parent process (via the _____________)
status value, wait() system call