• 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: WT <email@hidden>
  • Date: Mon, 24 Nov 2008 23:21:43 +0100

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.

Excellent! That solves one of my problems already. Thank you, 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


References: 
 >Re: Need some advice on multithreading (From: WT <email@hidden>)
 >Re: Need some advice on multithreading (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: NSPopupUpButton not showing checked menu items
  • Next by Date: NSOpenPanel Preview
  • Previous by thread: Re: Need some advice on multithreading
  • Next by thread: Re: Need some advice on multithreading
  • Index(es):
    • Date
    • Thread