Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Argh, MPCriticalRegion buggy :-(
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Argh, MPCriticalRegion buggy :-(



On Friday, September 7, 2001, at 12:45 PM, George Warner wrote:

On Thu, 6 Sep 2001 17:56:10 -0400, "Edward K. Chew" <email@hidden>
wrote:
I always thought critical regions ARE semaphores under another
name. It amazes me that you could mess up one without the
other. ;-)

Actually almost everything is a semaphore under the covers. ;-)

I thought as much. So let's see...can I infer from this that once semaphores are sped up in OS X, everything else (queues, event groups, critical regions, etc.) will benefit from an improvement of similar proportions? :-)

The critical region code handles multiple entry points and recursion (if a
routine enters a critical region and then calls itself it won't block
against the critical region that it already owns).

Oh right...I never considered the hazards of recursion, since most of my critical region code is in low-level leaf routines. I guess you would need to keep track of which thread entered the region, along with a counter to balance calls to enter/exit. That IS more complex than your basic access-controlling semaphore. Thanks for the enlightenment!

Ted
________________________________________________________________
//////////////////
// LAMONTAGNE // GEOPHYSICS LTD
////////////////// GEOPHYSIQUE LTEE Kingston ON Canada


References: 
 >Re: Argh, MPCriticalRegion buggy :-( (From: George Warner <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.