Being fast is a necessary condition of a real timesystem, but it is not sufficient. It has to meetexplicitly deadlines and being fast on the averagedoes not guarantee that a deadline will be met. If areal time system can be shown to meet its deadlinesthen we say that it is predictable. Multitasking isrequired to develop a good real time applicationPseudo parallelism “– to handle multiple externalevents occurring simultaneously. Rate monotonicscheduling (RMS) - is utilized to compute inadvance the processor power required to handle thesimultaneous events. Algorithms (schedulingmechanism) are needed to decide which task or thread will run at a given time. Function is toswitch from one task or process to another (contextswitch).
Overhead – should be completed as quickly as possible.
Dispatch time should be independent of thenumber of threads in the ready list.
Ready list should be organized each time anelement is added to the list.III. SCHEDULING:Scheduling is a fundamental operating systemfunction. All computer resource are scheduled before use, CPU is the primary resource .itsscheduling is central to operating-system design.3.1. CPU
:CPU scheduling is a task of selecting a waiting process from the ready queue and allocating theCPU to it. The CPU is allocated to the selected process by the dispatcher.
Under the following CPU scheduling can take place.1. When a process switches from the running stateto the waiting state (I/O request, or invocation of wait for the termination of one of the child processes).2. When a process switches from the running stateto the ready state (for e.g., when an interruptoccurs).3. When a process switches from the waiting stateto ready state (for e.g., completion of I/O).4. When a process terminates.In circumstances, 1 and 4 are non-preemptivescheduling, 2 and 3 are preemptive scheduling.
Once the CPU has been allocated to process the process keeps CPU until it release the CPU either by terminating or by switching to the waiting state.Example: - Microsoft window 3.1, appleMacintosh.
the dispatcher is the modulethat gives control of CPU to the process selected bythe short-term scheduler. The time it takes for thedispatcher to stop one process and start another running is known as dispatch latency.
Different CPU schedulingalgorithms have different properties and may favor one class of processes over another. Thecharacteristics used for comparison can make asubstantial difference in determination of algorithm. The criteria include the following:
To keep the CPU as busy as possible. CPU utilization may range from 0-100%.In real system it should range from 40% (for lightlyloaded system) to 90% (for heavily used system).
one measure of work is the number of processes completed for time unit called through put. E.g. for long process – 1process per hour. For short process – 10 process per second.
Turn around time:
How long it takes to executethat process. The interval from the time sufficientof a process to the time of completion is a turnaround time. Turn around time is the sum of periodspend waiting to get into memory, waiting in readyqueue, executing on CPU I/O.
The CPU scheduling algorithm doesnot affect the amount of time during which a process execute nor does I/O. It affects only theamount of time that a process spends waiting in theready queue. Waiting time is done sum of periodspend waiting in the ready queue.
The time from the submission of request until the first response is produced. Thismeasure is called response time. The amount of time it takes to start responding but not the timethat it takes to o/p that response. 3.2. SCHEDULING ALGORITHMS:CPU scheduling deals with the problems of deciding which of the processes in ready queue isto be allocated the CPU.
First come, first-severed scheduling
2. Shortest-job-first scheduling 3. Priority scheduling 4. Round-robin scheduling