The electronic forum deals with the topics related to analog and digital circuits and systems (i.e. ASIC, FPGA, DSPs, Microcontroller, Single/Multi Processors etc) and their programming such as HDL, C/C++, etc.

Name : Muhammad Irfan CMS = 7695Scheduling and its Types :Scheduler handles processes by sharing resources of the system to accomplish them. A schedules has its own unique way of giving equivalent resources of the processing unit to the processes. We will discuss some important types of schedulers. First is the process scheduler which decides that which process will run at a certain time. Second is the long-term scheduling which decides that which process is to be sent into the main memory. Third is the medium-term scheduler which temporarily removes the process from the main memory and places it in the secondary memory such as the hard-disk. Fourth is the short-term scheduler that chooses in-memory processes that are to be accomplished after a clock and input interrupt. It is more faster than long-term and mid-term schedulers. Another part of the CPU scheduling is the dispatcher which gives control of the CPU to the process selected by the short term scheduler. Scheduler distributes resources of the CPU on preference bases. Preference is given on either memory bases or user defined. Techniques are applied in sharing of resources in order to equally distribute them to every queue. Queues running at a time are limited or minimum shares of the resources are allotted to the queues in order to ensure equal sharing of resources to each queue and to improve the performance of the CPU if it is overloaded by so many processes or applications.

Name : Muhammad Shiraz CMS : 7694 SchedulingScheduler provides resources for applications or processes that a CPU will run. Scheduler provides the resources to these applications/processes on different priority bases. The scheduler first arranges these applications into queues. Each queue is shared resources equally. The priority may be memory based or defined by the user. Most often Priority is memory based in much systems. Preference is then given to those applications by the scheduler. The scheduler also allots minimum share of resources to the queues in order to give enough resources to each application. If a queue holds some applications so it will get its minimum required resources share but if does not contain apps so the extra resources are shared to other queues. If too many applications are running at the same time which will cause pretty much complexity in accessing data resources so the scheduler can limit the number of running applications per user or queue. The scheduler mainly focuses on the following tasks : 1. The total number of applications/processes that complete their running per unit time. 2. Total time between application/process submission and its completion. 3. Time taken from submitting of an application to the time it was scheduled. 4. Equal resource of the CPU given to each application. 5. The time the application remains in the ready queue. These are the tasks that scheduler is performing according to. We can say that the scheduler is facilitating all the tasks of the CPU and providing it to the applications.

Preemptive SchedulingCPU scheduling decisions take place under one of four conditions:When a process switches from the running state to the waiting state, such as for an I/O request or invocation of the wait( ) system call.When a process switches from the running state to the ready state, for example in response to an interrupt.When a process switches from the waiting state to the ready state, say at completion of I/O or a return from wait( ).When a process terminates.For conditions 1 and 4 there is no choice - A new process must be selected.For conditions 2 and 3 there is a choice - To either continue running the current process, or select a different one.If scheduling takes place only under conditions 1 and 4, the system is said to be non-preemptive, or cooperative. Under these conditions, once a process starts running it keeps running, until it either voluntarily blocks or until it finishes. Otherwise the system is said to be preemptive.Windows used non-preemptive scheduling up to Windows 3.x, and started using pre-emptive scheduling with Win95. Macs used non-preemptive prior to OSX, and pre-emptive since then. Note that pre-emptive scheduling is only possible on hardware that supports a timer interrupt.Note that pre-emptive scheduling can cause problems when two processes share data, because one process may get interrupted in the middle of updating shared data structures. Chapter 6 will examine this issue in greater detail.Preemption can also be a problem if the kernel is busy implementing a system call ( e.g. updating critical kernel data structures ) when the preemption occurs. Most modern UNIXes deal with this problem by making the process wait until the system call has either completed or blocked before allowing the preemption Unfortunately this solution is problematic for real-time systems, as real-time response can no longer be guaranteed.Some critical sections of code protect themselves from concurrency problems by disabling interrupts before entering the critical section and re-enabling interrupts on exiting the section. Needless to say, this should only be done in rare situations, and only on very short pieces of code that will finish quickly, ( usually just a few machine instructions. )