• 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: How to create secondary Thread that listens to event taps?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to create secondary Thread that listens to event taps?


  • Subject: Re: How to create secondary Thread that listens to event taps?
  • From: RenĂ© v Amerongen <email@hidden>
  • Date: Wed, 20 Oct 2010 15:36:20 +0200

Having something similar a few days back and did also use the second thread, I am curious and looking for a sample or at least more information how to do the custom CFRunLoopSource solution.
Any info on that for us?

Thanks in advance.

René

Op 20 okt 2010, om 07:44 heeft Chris Hanson het volgende geschreven:

> On Oct 19, 2010, at 12:41 PM, Rainer Brockerhoff wrote:
>
>> A too-low value will make your thread activate too often (making it use more CPU when idle) and a too-high value will make it too slow to react to "condition" being set to NO. I usually set something between 0.5 and 1; it's optimal in the sense "works-for-me" ;-)
>
> Rather than do that, create another, custom CFRunLoopSource that can be used to wake up the run loop (via CFRunLoopSourceSignal) when the condition changes.
>
> Then instead of just
>
>  condition = NO;
>
> use
>
>  condition = NO;
>  CFRunLoopSourceSignal(mySource);
>
> to wake the run loop immediately.  That'll let you set a nice high timeout rather than something low like 0.5 or 1, and prevent you from wasting CPU.
>
>  -- Chris
>
> _______________________________________________
>
> 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

_______________________________________________

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

References: 
 >Re: How to create secondary Thread that listens to event taps? (From: eveningnick eveningnick <email@hidden>)
 >Re: How to create secondary Thread that listens to event taps? (From: Rainer Brockerhoff <email@hidden>)
 >Re: How to create secondary Thread that listens to event taps? (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: How to create secondary Thread that listens to event taps?
  • Next by Date: Set TextView font in IB
  • Previous by thread: Re: How to create secondary Thread that listens to event taps?
  • Next by thread: [Q] Using NSInvocation vs. selector with NSTimer
  • Index(es):
    • Date
    • Thread