• 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: Need some advice on multithreading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need some advice on multithreading


  • Subject: Re: Need some advice on multithreading
  • From: Ken Thomases <email@hidden>
  • Date: Mon, 24 Nov 2008 14:46:14 -0600

On Nov 24, 2008, at 1:39 PM, WT wrote:

That's exactly what I had done in the first place, but the results weren't too good. I then wrote a much simpler app (one bouncing ball) to test possible solutions and, of course, started with this very approach. For fun, I allow the user to rotate the container and, sure enough, the ball hangs in mid-air while I'm rotating the view. And this, of course, happens regardless of how slow the steps are because the problem is really that the simulation, the drawing, and all the event handling all happen in the same thread (the main thread), so when I'm playing with the slider, the simulation is not running.

NSTimers are scheduled in particular run-loop modes. Tracking of a mouse drag on a control runs in a special mode, NSEventTrackingRunLoopMode. If you schedule your timer to run in that mode, too, it will keep running while tracking is going on.


Cheers,
Ken

_______________________________________________

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: Need some advice on multithreading
      • From: WT <email@hidden>
References: 
 >Re: Need some advice on multithreading (From: WT <email@hidden>)

  • Prev by Date: Re: Determining use of serial comma
  • Next by Date: Re: NSPopupUpButton not showing checked menu items
  • Previous by thread: Re: Need some advice on multithreading
  • Next by thread: Re: Need some advice on multithreading
  • Index(es):
    • Date
    • Thread