• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Re: Yielding an NSThread-started thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Yielding an NSThread-started thread


  • Subject: Re: Re: Yielding an NSThread-started thread
  • From: "Philip Q" <email@hidden>
  • Date: Wed, 22 Nov 2006 15:58:33 +1300

On 22/11/06, Alastair Houghton <email@hidden> wrote:
Ah.  You seem to misunderstand the term "condition variable".  A
condition variable is a special type of synchronisation primitive,
which you can signal from one thread and wait on from another.  It
doesn't mean a boolean flag variable that you test each time around a
loop.

That makes sense, thanks!

In Cocoa, you probably want to use NSConditionLock for this kind of
application.  That way you don't have any busy waiting going on.
You'd do something like:

Does that mean that [myLock lockWhenCondition:0] yields if the lock is not available (while it's checking)?

-Phil
_______________________________________________

Cocoa-dev mailing list      (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins (at) lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Yielding an NSThread-started thread
      • From: Chris Suter <email@hidden>
References: 
 >Yielding an NSThread-started thread (From: "Philip Q" <email@hidden>)
 >Re: Yielding an NSThread-started thread (From: Alastair Houghton <email@hidden>)
 >Re: Re: Yielding an NSThread-started thread (From: "Philip Q" <email@hidden>)
 >Re: Yielding an NSThread-started thread (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: External kill of an NSThread?
  • Next by Date: Re: Yielding an NSThread-started thread
  • Previous by thread: Re: Yielding an NSThread-started thread
  • Next by thread: Re: Yielding an NSThread-started thread
  • Index(es):
    • Date
    • Thread