private storage area(used for DLLs),register set(status of the processor), and a stack(user stack when running in user mode & kernel stack for kernel mode)
As is clear from here, shares code & data section
What exactly is medium grained parallelism? In 1 sentenceSingle application is a collection of threadsThreads usually interact frequently, affecting the performance of the entire application
Processes not assigned to a particular processorA global queue of ready threads is maintainedEach processor, when idle , selects a thread from the queue.
Explain 2nd point…when processor is available,schedulingalgo is run to select next ttread according to the desire of the programmer
Add about Mach OSpointA refinement of the load-sharing technique is used in the Mach operating system[BLAC90, WEND89]. The operating system maintains a local run queue foreach processor and a shared global run queue. The local run queue is used bythreads that have been temporarily bound to a specific processor. A processor examinesthe local run queue first to give bound threads absolute preference over unboundthreads. As an example of the use of bound threads, one or more processorscould be dedicated to running processes that are part of the operating system.May be a bottleneck when more than one processor looks for work at the same time
There are two observations regarding this extreme strategy that indicate better than expected performance:In a highly parallel system, with tens or hundreds of processors, each of which represents a small fraction of the cost of the system, processor utilization is no longer an extremely important metric for effectiveness or performance.Total avoidance of process switching during the lifetime of a program should result in a substantial speedup of that program
As seen from the diag., the scheduler converts the threads priority into a global priority and then schedules the highest one foremost.The real time processes are given highest priority.
Priority and time slice are inversely proportionalInteractive processes have a higher priorityCPU bound processes have a lower priority
Interactivity is determined depending on the sleep time of the task, ie, how long it has been waiting for I/OTasks that are more interactive have higher sleep times
A runnable task is considered eligible for execution as long as it has its remaining time quantumThe runnable tasks are maintained on a runqueue data structure which contains 2 priority arraysOn multiprocessors,each processor schedules the highest priority task from its own runqueueWhen exhausted the 2 arrays are exchanged
Schedules threads using a priority-based, preemptive scheduling algorithm.
divided according to the Win32 API.Each thread has a bWhen released from wait operation, its
Addeg of foreground & background process
Thread scheduling in Operating Systems
THREAD SCHEDULING By- Nitish Gulati
THREADS… It is the basic unit of CPU utilization Comprises of thread ID, private storage area, register set, and a stack
TYPES OF THREADS Threads User level Kernel level
OPERATING SYSTEM ARCHITECTURE USER APPN. KERNEL H/W
COMPARISONParameters User Level Threads Kernel Level Threads1. Support Managed without the Managed by the OS kernel2 . Implementation Through the following Through the following thread models thread models •many to many •One to one •many to one3. Examples Depends on the •Windows XP application •Solaris 9 •Linux
NEED OF THREAD SCHEDULING? To exploit the power of parallelism in a multiprocessor. Utilized in medium grained parallelism.