Quiz #4 Flashcards
How many program can execute at a time without a O/S?
Without an O/S, only one program can be executed at a time
How do you change the running program
A CPU reset and some way of loading a new program (flashing, loading from tape, etc.) is required to change the running program,.
How much control does the running program have?
The running program has full control and 100% use of the resources of the computer(since It is the only thing running)
How many programs can be ran with a O/S?
O/Ses allow more than one program to be loaded at a time and allow us the ability to switch between loaded programs using the concept of a process
What is a process? What can you do with them
a process is a program in execution. A process can be paused, restarted, stored and executed
What are the parts of a process?
- Processor registers including the program counter
- The program code, also called text section
- Stack containing temporary data; Function parameters, return addresses, local
variables - Data section containing global variables
- Heap containing memory dynamically
allocated during run time
What is a process’s address space? What are segments?
- A process’s address space is the range of memory addresses accessible by that process.
The address space is comprised of 3
segments and the heap. The text
segment, contains the executable code
(called the program text, but it is NOT
text!). the data segment contains
constant and global data. The stack
segment contains local variables.
Highest Memory Address
Stack
Heap
Data
Text
A program is a ____ entity stored on disk ( ____ ___), a process is ___
Programs become ___ when executed
every process must have ____ ____ ____
Several process may have the ___ ___
passive, executable file, active
process
exactly one program
same program
What is a process
A process is an activity of some kind. It
has a program, an address space input, output
and a register state.
What is a program?
A program is a set of executable instructions
that may be stored on disk, not necessarily
doing anything
If a program is running ___, it counts as ___ processes. The fact that ___ processes are running the same program doesn’t matter. They are ___ ____ processes.
twice, 2, two, 2 distinct
Which is a program and a process? A movie on a dvd, playing the movie
program - a movie on a dvd
process - playing the movie
Two users are logged into a single-CPU Linux server. User #1 begins a lengthy process to calculate pi to 50 decimal places: 3.14159265358979323846…. User #2 begins a equally lengthy process to sort 1000 names. Both users claim that the CPU is working on her problem. How can this be? There is only 1 CPU.
O/Ses allow more than one program to be loaded at a time and allow us the ability to switch between loaded programs using the concept of a process.
- CPU switches from process to process quickly, giving the illusion of ____
- Each process is allowed to run for tens or hundreds of millisecond stretches (called a ____ ____ or ____ )
- This rapid switching is called _____
parallelism
time slice, quantum
multiprogramming
How does the CPU do multiprogramming?
- multiprogramming through rapid
context switching between processes amounts to the O/S abstracting a single physical CPU into multiple virtual CPUs (one per process). - From each process’s point of view, it is running
on a dedicated CPU.
What is the core component of the operating system kernel? What is above that layer?
process scheduler
the set of processes to be sequentially executed
As process executes, it changes state. What are those states and what do they mean?
- new: The process is being created
- running: Instructions are being executed
- waiting: The process is waiting (blocked) for some event to occur
- ready: The process is waiting to be assigned to a processor
- terminated: The process has finished
execution
What is the diagram of process state?
- Process newly created blocks for input, New -> Ready
- Process picked to run becomes available, Ready -> Running
3 - Another process picked to run, Running -> Ready
4 - Process, Running -> Waiting
5 - Input, Waiting > Ready
6 - The process ends, Terminated