Re: Thread scheduling vs Process scheduling

On 3/5/2010 1:10 PM, Dilip wrote:

In WinCE, the scheduler does a thread scheduling instead of process
scheduling? What is the difference between the thread scheduling and the
process scheduling and what are the advantages of the thread scheduling over
process scheduling ?

In windows CE the threads are scheduled based on their priority. There is no concept of "process priority" and the scheduler is quite simple. Round robin between all the highest priority threads and a single level of priority inversion. No dynamic priority changes controlled by the scheduler (to rise the priority of a thread that hasn't been running for a long time, for example), but dynamic priority management allowed with specific APIs.
The process is an address space where one or more threads can run.
When the scheduler activate a thread it checks if it should remap the MMU to active the process address space where that thread is supposed to run.
Working with threads instead of processes where an execution flow and an address space are coupled will allow you to have multiple flows of execution (thread) sharing the same data and resources (inside the process address space), without requiring any marshaling of those resources (no copies, no remaps).
On the other side all the resources shared by multiple threads may need to be syncronized and this makes development more complex.
When you design a system based on Windows CE you should carefully choose what to implement as a thread inside a shared process and what to implement as a distinct process. Using too many processes may involve some overhead to share information, using only threads may lead to a less reliable system because a failure in a single thread may impact all the thread sharing the same process space.

Valter Minute (eMVP)
Training, support and development for Windows CE:
My embedded programming and cooking blog:
Windows Embedded support forums in Italian:
(the reply address of this message is invalid)

Relevant Pages

  • Re: general newbie questions about MSP concepts
    ... First lesson: Project and the computer it runs on has an IQ of zero!!:) ... Second lesson is that planning precedes scheduling. ... Now add resources and you get the hours per week needed from each resource ... > if i increase the priority of a task, ...
  • Re: Sharing the timeslice
    ... PTHREAD_SCOPE_SYSTEM threads for the CPU. ... scheduling policy and the thread's priority. ... Priorities and Scheduling Policy ...
  • Re: CMUCL versus SBCL: big differences?
    ... > Last time I tried running "realtime" priority threads in Windows, ... > their scheduling was disrupted simply by scrolling a web-browser ... I'm not trying to defend Windows. ...
  • Re: Fair scheduling of the equal priority tasks in RTOS
    ... maximum scheduling delay. ... While optimizing the order of the tasks, it consumes the CPU resources by itself. ... at essentially the same "priority" and still be guaranteed ... a condition variable instead of having the OS add support ...
  • Re: CMUCL versus SBCL: big differences?
    ... Yes- I had a realtime max priority thread servicing the control lines on ... scheduling timing enough to screw up the signalling protocol- which is ... Presumably the Windows ...