Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming.threads > #485
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder1.news.weretis.net!news.albasani.net!.POSTED!not-for-mail |
|---|---|
| From | BGB <cr88192@hotmail.com> |
| Newsgroups | comp.lang.c, comp.programming.threads, comp.unix.programmer |
| Subject | Re: POSIX threads hard to implement in Windows |
| Date | Wed, 03 Aug 2011 07:32:11 -0700 |
| Organization | albasani.net |
| Lines | 42 |
| Message-ID | <j1bme3$vsa$1@news.albasani.net> (permalink) |
| References | <iuso52$shb$1@dont-email.me> <iussos$ndi$1@speranza.aioe.org> <97ek3iFq2bU2@mid.individual.net> <4e13c801$0$20925$a729d347@news.telepac.pt> <lnwrfw1679.fsf@nuthaus.mib.org> <4e13d4a7$0$20921$a729d347@news.telepac.pt> <iv0ljc$fce$1@dont-email.me> <jobee8-aki.ln1@jones.homeip.net> <lnbox70xby.fsf@nuthaus.mib.org> <37pfe8-4gl.ln1@jones.homeip.net> <iv42dd$ed2$2@dont-email.me> <iv4blu$79l$1@dont-email.me> <c1ahe8-hi.ln1@wilbur.25thandClement.com> <97mi1gFbcvU4@mid.individual.net> <487c17t7h0f64f1mjmm83gj5f080o56cfa@4ax.com> <iv5p2f$95u$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.albasani.net lJ500u9jVaTRLMgIHkwuTOJ6cP0rouOez8lMsOGJG1iW5K+X2EQ3uvaUGXEzLG2xbN+bQ3/uJ+Dz8JtRuhaQoA== |
| NNTP-Posting-Date | Wed, 3 Aug 2011 14:36:51 +0000 (UTC) |
| Injection-Info | news.albasani.net; logging-data="ju+vP/U8uXH2aWF83QXYeMhqnkX5zoY4020A2Rxs3UwWkfkmadjteryJ6qGv15khkYftjgMACpFBW7usQgsX27Y1HNRi4uWLrh77BxwzwfOmQyBFAJaaJ8QCrr3Xs3I5"; mail-complaints-to="abuse@albasani.net" |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 |
| In-Reply-To | <iv5p2f$95u$1@dont-email.me> |
| Cancel-Lock | sha1:BbpueZItqk63sh2d0XLKD64A5QE= |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.c:9006 comp.programming.threads:485 comp.unix.programmer:1053 |
Cross-posted to 3 groups.
Show key headers only | View raw
On 7/7/2011 7:12 PM, MikeP wrote: > Robert Wessel wrote: >> On Fri, 08 Jul 2011 08:07:30 +1200, Ian Collins<ian-news@hotmail.com> >> wrote: > >>> Does the windows API support process shared mutexes? The C1x >>> proposal doesn't include them probably because the process model is >>> beyond the C standard. >> >> >> Sure. Most of the synchronization objects in Windows are system wide. > > CAN be. If you name them, THEN they can be used amongst processes. > Unnamed synch objects are intra-process. Whether having unnamed synch > objects makes them lighter-weight (higher performance) in usage, I don't > know. Simple enough to profile though. > these mutexes are very expensive, almost absurdly slow. a lock/unlock cycle takes around 1-2us, which is far longer than most operations one may reasonably want to lock (on a reasonably modern computer, this is around 3000 to 6000 clock cycles). "Critical Sections" are a bit faster, and so are preferable to the generic mutex objects (but, much faster than dead slow is still not necessarily fast). much faster IME was to implement a spinlock-with-sleeep operation (using "InterlockedExchange", ...), which can generally handle locking/unlocking in the low ns range (more around 5ns or so). the above fast mutexes make a lot more sense when ones' goal is something like: lock mutex; add entry to cross-thread linked list (such as a message queue); unlock mutex. or: the corresponding action to remove something from a linked-list. rather than... whatever the hell MS intends their mutexes for...
Back to comp.programming.threads | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
POSIX threads hard to implement in Windows (was: C is fixed or not ?) Noob <root@127.0.0.1> - 2011-07-07 15:17 +0200
Re: POSIX threads hard to implement in Windows William Ahern <william@wilbur.25thandClement.com> - 2011-07-07 11:21 -0700
Re: POSIX threads hard to implement in Windows Ian Collins <ian-news@hotmail.com> - 2011-07-08 08:07 +1200
Re: POSIX threads hard to implement in Windows Robert Wessel <robertwessel2@yahoo.com> - 2011-07-07 16:01 -0500
Re: POSIX threads hard to implement in Windows "MikeP" <mp011011@some.org> - 2011-07-07 21:12 -0500
Re: POSIX threads hard to implement in Windows Robert Wessel <robertwessel2@yahoo.com> - 2011-07-07 23:33 -0500
Re: POSIX threads hard to implement in Windows "MikeP" <mp011011@some.org> - 2011-07-07 23:49 -0500
Re: POSIX threads hard to implement in Windows BGB <cr88192@hotmail.com> - 2011-08-03 07:32 -0700
Re: POSIX threads hard to implement in Windows William Ahern <william@wilbur.25thandClement.com> - 2011-07-07 15:06 -0700
Re: POSIX threads hard to implement in Windows lawrence.jones@siemens.com - 2011-07-10 16:08 -0400
Re: POSIX threads hard to implement in Windows William Ahern <william@wilbur.25thandClement.com> - 2011-07-10 16:09 -0700
Re: POSIX threads hard to implement in Windows James Kuyper <jameskuyper@verizon.net> - 2011-07-11 06:20 -0400
Re: POSIX threads hard to implement in Windows Ian Collins <ian-news@hotmail.com> - 2011-07-11 22:36 +1200
Re: POSIX threads hard to implement in Windows scott@slp53.sl.home (Scott Lurndal) - 2011-07-11 16:18 +0000
Re: POSIX threads hard to implement in Windows Geoff Clare <geoff@clare.See-My-Signature.invalid> - 2011-07-12 13:30 +0100
Re: POSIX threads hard to implement in Windows (was: C is fixed or not ?) Joshua Maurice <joshuamaurice@gmail.com> - 2011-07-07 19:01 -0700
Re: POSIX threads hard to implement in Windows (was: C is fixed or not ?) "Ersek, Laszlo" <lacos@caesar.elte.hu> - 2011-07-14 23:05 +0200
csiph-web