Chapter 4 Flashcards
(33 cards)
Differentiate a job and a process.
A process is an active entity and an instance of a program that requires a set of resources while a program is an unactive entity submitted by user.
What is multi-threading?
Multithreading allows applications to manage a separate process with several threads of control.
What is multiprogramming?
The processor allocated to each job or to each process for a period of time and deallocated at an appropriate moment
What’s the one condition that allows several jobs or processes to share a single processor.
Scheduling policy
What are the two submanagers the composes the Process Manager?
Job Scheduler (high-level scheduler) and Process Scheduler (low-level scheduler)
The Job Scheduler’s goal is___.
- To put jobs in a sequence that best meets the designers or admins’ goals.
- To keep most components of the computer system busy most of the time
The Process Scheduler ____
- Determines which processes will get the CPU, when, and for how long.
- Decides what to do when processing is interrupted
- Determines which waiting lines (queues) the job should be moved to during its execution.
- Recognizes when a job has concluded and should be terminated.
What is the purpose of a middle-level scheduler in a highly interactive environment?
Manages the swapping in and out of jobs
Outline the job status, process status or thread status .
- HOLD - status of a job after the it is accepted by the system
- READY - jobs move to this status after interrupts are resolved
- RUNNING - status of a job currently being processed
- WAITING - job can’t continue until a specific resource is allocated or an I/O operation has finished
- FINISHED - status of a completed job
Each process in the system is represented by a data structure called a __.
Process Control Block
Each thread in the system is represented by a data structure called a __.
Thread Control Block
Outline the contents of a Process Control Block (PCB).
Process identification
Process status
Process state:
Process status word
Register contents
Main memory
Resources
Process priority
Accounting
Outline the contents of a Thread Control Block (TCB).
Thread identification
Thread state
CPU information:
Program counter
Register contents
Thread priority
Pointer to process that created this thread
Pointers to all other threads created by this thread
What are characteristics of a good scheduling policy?
- Maximize throughput - Run as many jobs as possible in a given amount of time
- Minimize response time - Quickly turn around interactive requests
- Minimize turnaround time - Move entire jobs in and out of the system quickly
- Minimize waiting time - Move jobs out of the READY queue as quickly as possible
- Maximize CPU efficiency - Keep the CPU busy 100 percent of the time
- Ensure fairness for all jobs - Give everyone an equal amount of CPU and I/O time
A job runs until___.
- The timer goes off
- The job issues an I/O command
- The job is finished
An I/O request is called a __.
natural wait
Preemptive scheduling policy is commonly used in time-sharing environments. Describe this scheduling strategy.
This strategy interrupts the processing of a job and transfers the CPU to
another job
Describe the nonpreemptive scheduling policy.
A job remains in in the RUNNING state uninterrupted until it issues an I/O request (natural wait) or until it is finished.
List the scheduling algorithms.
- First-Come, First-Served
- Shortest Job Next
- Priority Scheduling
- Shortest Remaining Time
- Round Robin
- Multiple-Level Queues*
- Earliest Deadline First
Describe the First-Come, First-Served scheduling algorithm.
- a nonpreemptive scheduling algorithm that is easy to implement
- handles all incoming objects according to their arrival time: the earlier they arrive, the sooner they’re served
- there are no WAIT queues
What is the disadvantage of the First-Come, First-Served scheduling algorithm?
The average turnaround times vary widely and are seldom minimized. In fact, when there are three jobs in the READY queue, the system has only a 1 in 6 chance of running the jobs in the most advantageous sequence (C, B, A)
Describe the Shortest Job Next scheduling algorithm
- a nonpreemptive scheduling algorithm that minimizes average
waiting time - handles jobs based on the length of their CPU cycle time
What is the disadvantage of the Shortest Job Next scheduling algorithm?
- Indefinite postponement of some jobs
- requires execution times in advance
Describe the Priority scheduling algorithm
- a nonpreemptive algorithm
- gives preferential treatment to important jobs and they aren’t interrupted until their CPU cycles are completed or a natural wait occurs.
- different queue for each priority level