On Sun, 19 Apr 2009 00:11:04 +0800, ???? <wso_angel@hotmail.com> wrote:
the question is the same as title :)
thanks and regards
You can find a lot on this by plugging "mutex critical_section
difference"
into Google, minus the quotes. Briefly, both implement the (recursive)
mutex concept. Some of their properties and differences are:
MUTEX (my caps)
1. Kernel object represented by a HANDLE. It can be used between
processes
and with functions such as WaitForSingleObject.
2. All operations require kernel transitions, making it potentially
slower.
CRITICAL_SECTION
1. A poorly named mutex that is sort of a mix between kernel and
non-kernel
objects. Can only be used within a single process and cannot be used with
WaitForSingleObject and other HANDLE functions.
2. Acquisition in the uncontended state and release do not involve kernel
transitions, making these operations potentially faster than the
corresponding MUTEX operations.
The CRITICAL_SECTION should be used by default.
--
Doug Harrison
Visual C++ MVP