>Number: 4027
>Category: os-windows
>Synopsis: multithread.c uses WaitForSingleObject, shoud use
>EnterCriticalSection for unnamed mutexes
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: apache
>State: open
>Class: change-request
>Submitter-Id: apache
>Arrival-Date: Tue Mar 9 13:30:01 PST 1999
>Last-Modified:
>Originator: [EMAIL PROTECTED]
>Organization:
apache
>Release: 1.3.4
>Environment:
Windows NT
>Description:
EnterCriticalSection() is very fast, especially when there the caller does not
wait. This clearly a better choice than the current implementation using
WaitForSignleObject().
In addition, you can optionally spin on a CriticalSection.
>How-To-Repeat:
>Fix:
Unfortunately named and unnamed mutexes use the same routines. The best thing
to do would probably be to break out the operations for named mutexes e.g.
ap_create_mutex() and ap_create_named_mutex()
where the named mutexes use NT Mutexes and unnamed use CriticalSections.
Alternatly you could define mutex to be a tagged union so the mutex routines
could operate on both CriticalSections and Mutexes.
I'll probably work on this, so send me mail.
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <[EMAIL PROTECTED]> in the Cc line ]
[and leave the subject line UNCHANGED. This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig- ]
[nored unless you are responding to an explicit request ]
[from a developer. ]
[Reply only with text; DO NOT SEND ATTACHMENTS! ]