• 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: GUI threading question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GUI threading question


  • Subject: Re: GUI threading question
  • From: Michael Ash <email@hidden>
  • Date: Mon, 2 Feb 2009 11:39:55 -0500

On Mon, Feb 2, 2009 at 11:03 AM, Scott Ribe <email@hidden> wrote:
>> It has long been my understanding that in order to keep a GUI from
>> freezing in Cocoa during LONG methods you have to create a
>> NSOperationQueue and load the method as a NSInvocationOperation as seen
>
> No, you have to run the long operations on another thread. NSOperationQueue
> is supposed to provide an easy way to do that, but it's not necessary. You
> can start a thread and arrange to receive its results using NSThread, or
> MPTasks, or pthreads...

Or you can spawn another process and talk to it asynchronously. Or you
can break your LONG method up into a bunch of SHORT operations, which
you then call from a timer.

The only thing you HAVE to do to keep the GUI responsive is not block
the event loop for a noticeable amount of time. How you actually do
that is entirely up to you. NSOperation is just one of many options.

Mike
_______________________________________________

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: 
 >GUI threading question (From: email@hidden)
 >Re: GUI threading question (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: Questions regarding programming custom visual components
  • Next by Date: Re: GUI threading question
  • Previous by thread: Re: GUI threading question
  • Next by thread: Re: GUI threading question
  • Index(es):
    • Date
    • Thread