public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: Scott McCaskill <scott@3dfx.com>
To: 'Tristan Savatier' <tristan@mpegtv.com>,
	"'pthreads-win32@sources.redhat.com'"
	<pthreads-win32@sources.redhat.com>
Subject: RE: Mutex implementation questions
Date: Mon, 02 Oct 2000 15:04:00 -0000	[thread overview]
Message-ID: <BFB941396BAED3118E1E00A0C9F2D365314264@aub1exch01.austin.3dfx.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]

Title: RE: Mutex implementation questions







> -----Original Message-----
> From: Tristan Savatier [ mailto:tristan@mpegtv.com ]
> Sent: Monday, October 02, 2000 5:10 PM
> To: 'pthreads-win32@sources.redhat.com'
> Subject: Mutex implementation questions
> 
> 
> I noticed that if _pthread_try_enter_critical_section has been set
> to a non-NULL value by DllMain, Mutexes are implemented using
> critical sections (InitializeCriticalSection) instead of 
> CreateMutex, regardless of the value of the implemetation-specific
> forcecs
> mutex attribute.
> 
> According to "Win32 programming", critical sections are light weight
> compared to mutexes, they are not managed by the kernel, and they
> are much faster than mutexes.  So why no use critical sections
> all the time to implement pthread mutexes ?
> 
> Are there cases where critical sections are not available or
> wouldn't work well ?
> 


Yes, I'm pretty sure critical sections can't be shared between processes (but mutexes can).  So this may be the reason.




             reply	other threads:[~2000-10-02 15:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-02 15:04 Scott McCaskill [this message]
2000-10-02 15:59 ` Tristan Savatier
2000-10-02 23:24   ` Ross Johnson
  -- strict thread matches above, loose matches on Subject: below --
2000-10-11  8:37 Bossom, John
2000-10-03  4:38 Bossom, John
2000-10-05 19:55 ` Tristan Savatier
2000-10-08 21:58   ` Ross Johnson
2000-09-28 10:53 Memory leak in pthread_setcanceltype()? Bossom, John
2000-10-02 15:01 ` Mutex implementation questions Tristan Savatier
2000-10-02 23:36   ` Ross Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BFB941396BAED3118E1E00A0C9F2D365314264@aub1exch01.austin.3dfx.com \
    --to=scott@3dfx.com \
    --cc=pthreads-win32@sources.redhat.com \
    --cc=tristan@mpegtv.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).