Critical Section RRS feed

  • Question

  • Hi,

    I am going through the documentation and it is mentioned that Mutex is a pure Kernel Object where as Critical Section is not. Then to which module CS belongs?



    Thursday, June 13, 2013 10:17 AM

All replies

  • Critical Sections run in your code.   They may be in Coredll.dll, or simply coredll.lib.

    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG

    Eurotech Inc.

    Thursday, June 13, 2013 12:38 PM
  • Criticalsection is also the part of Kernel you can see the functions in the different name in the below file


    These functions are used by the critical section APIs in the coredll which is exposed outside



    Thursday, June 13, 2013 4:29 PM
  • Hello Bruce Eitman and Vinoth,

    Thank You for the reply.

    I had gone through those source code files long ago, but not just before starting the discussion.

    I was reading Windows CE Fundamentals PDF in this page-95 talks about synchronization objects. 

    It is given in page-95 that "

    As opposed to a critical section, a mutex is a pure-kernel object, and therefore, when accessed by another process, regardless of blocking, the kernel is called, which results in considerable overhead"

    If Critical section is also part of kernel then what does mean by the above statement?



    Friday, June 14, 2013 4:37 AM
  • you have to see the word "Pure kernel object" for Mutex. Yes it is correct. if you see the


    You can see the NKCreateMutex which is directly exposed as kernel API.

    See the


    But for critcal section API, it is implemented in coreDLL which call the critical section function implemented in kernel.


    Friday, June 14, 2013 5:49 AM
  • The statement that you referred might be stressing that Mutex are costly and slower than Critical section. There is significant overhead using Mutex vs critical section. So use it appropriately.  As far as I know mutex are ~100 times slower than critical.



    Friday, June 14, 2013 8:23 AM