• 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: CFRunLoopStop exception
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFRunLoopStop exception


  • Subject: Re: CFRunLoopStop exception
  • From: Steve Sisak <email@hidden>
  • Date: Fri, 9 Apr 2010 06:50:48 -0400

At 10:03 PM +0200 4/8/10, vincent habchi wrote:
I was running quite an intensive test on creating/freeing threads running RunLoops, and I got a rather unexpected crash while executing CFRunLoopStop ():

At 10:07 PM +0200 4/8/10, vincent habchi wrote:
Well, I forgot to mention that each thread is responsible for the drawing of a CATileLayer, if that matters.

At 7:40 AM +0200 4/9/10, vincent habchi wrote:
Okay, so that means it is impossible to ask a run loop to stop while it is being messaged to wake up. Practically, this might not be a severe threat, but when you begin to create/destroy threads at small intervals (say, 50 ms), the collision seems to be inevitable (especially since I also use timers to wake up the loops).

Pulling these out, it may be time to look at WAYRTTD.

Creating/destroying lots of threads to render tiles seems massively inefficient for lots of reasons and Mac OS X has much better mechanisms for this.

Depending on what minimum OS requirements you might get much better results using Grand Central Dispatch or any of a number of appropriate approaches like Operation Queues or Dispatch Queues, down to managing your own pool of worker threads with a number of threads on the order of the number of cores available.

Try starting here:

<http://developer.apple.com/mac/library/DOCUMENTATION/General/Conceptual/ConcurrencyProgrammingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008091>

HTH,

-Steve

_______________________________________________

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: CFRunLoopStop exception
      • From: vincent habchi <email@hidden>
  • Prev by Date: Re: CFRunLoopStop exception
  • Next by Date: Re: CSS style string to NSAttributedString attributes conversion
  • Previous by thread: Re: CFRunLoopStop exception
  • Next by thread: Re: CFRunLoopStop exception
  • Index(es):
    • Date
    • Thread