thanks and regards
>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
"Doug Harrison [MVP]" <d...@mvps.org> 写入消息
news:ll2ku4p9k7o31fqq0...@4ax.com...
http://en.wikipedia.org/wiki/Kernel_(computing)
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925