Answered User Mode Scheduling efficiency vs kernel mode scheduling

All Replies

  • Tuesday, March 13, 2012 5:32 AM
    Owner
     
     Answered

    Hi Ali,

    If you are creating and using threads today, by default, you are using the kernel mode scheduler. If you would like to switch to UMS, then you have to follow the API set in the link you posted above to implement your own. However, that said, it is not trivial to implement a UMS scheduler on your own and you have to carefully weigh the benefits.

    Are you using PPL and ConcRT? If so, we allow you to choose a UMS scheduler underneath (in Visual 2010 only)- by simply setting the scheduler option. http://msdn.microsoft.com/en-us/library/dd492562.aspx

    High performance application is loosely defined as any application, whose success is extremely sensitive to performance e.g. media processing, games etc. What UMS promises is three things:

    1. Very low context switch overhead (about 10X faster that kernel mode context switching).

    2. Response to kernel level blocking. Say your application is using 4 threads on a 4 core box. If one of the threads does a I/O call, or blocks on a critical section, UMS gives you the ability to respond to the blocking call by creating additional user mode threads.

    3. Developer control of which user mode thread to execute next (as opposed to letting the OS scheduler round robin through them). There are a class of apps that this is useful for.

    If your app falls in the category where it can take advantage of the promises, then you will find UMS beneficial.


    Rahul V. Patil