• 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: Pausing an NSThread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pausing an NSThread


  • Subject: Re: Pausing an NSThread
  • From: Kyle Sluder <email@hidden>
  • Date: Sat, 7 Nov 2009 19:36:53 -0800

On Sat, Nov 7, 2009 at 7:28 PM, Ron Fleckner <email@hidden> wrote:
> This is a small proof-of-concept/test kind of project. I've had a look at
> NSConditionLock, but I don't get the concepts.  So I've got this naïve
> solution, which is a kind of polling, I know, but it _seems_ to work quite
> well.  The CPU usage goes down to zero according to Activity Monitor while
> the thread is 'paused'.  That's gotta be a good sign.

No, it just means you didn't screw up in an obvious way.  It doesn't
mean you're free of race conditions, corner cases, or other bugs you
haven't tripped on yet.

It would behoove you to read a good introduction to multithreading
that explains condition locks and other threading primitives.  The
Cocoa docs expect you to have this foundation already.  Unfortunately,
I don't have a link handy.  Mind you, even the best tutorial won't
save you from the fact that multithreaded programming is very
difficult, and quite often doesn't get you the results you're looking
for even when done correctly.  This is one reason why the Cocoa APIs
favor runloop-based asynchrony over multithreading.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: Pausing an NSThread
      • From: Ron Fleckner <email@hidden>
References: 
 >Pausing an NSThread (From: Ron Fleckner <email@hidden>)

  • Prev by Date: Re: Pausing an NSThread
  • Next by Date: Re: Pausing an NSThread
  • Previous by thread: Re: Pausing an NSThread
  • Next by thread: Re: Pausing an NSThread
  • Index(es):
    • Date
    • Thread