• 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: sending msgs to nsoperation threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sending msgs to nsoperation threads


  • Subject: Re: sending msgs to nsoperation threads
  • From: "email@hidden" <email@hidden>
  • Date: Thu, 11 Nov 2010 09:35:07 +0000

On 11 Nov 2010, at 07:13, Shane wrote:

> I've got an NSOperation thread running, but I'd like to be able to
> send a message to it so that the thread can be shut it down, or
> possibly other commands.
>
> What is considered a good way to send a message to an NSOperation
> thread from the apps main thread?
> _______________________________________________
>

NSOperation is a great way to schedule a distinct and largely none interacting operation.
It is not a universal concurrency solution.

I would drop down to NSThread in this situation.
You have to do a bit more management but you get the control you need.

Also NSOperation generated threads do not, IIRC, instantiate a run loop.
If you want to message your thread using performSelector:onThread you will need a run loop.

Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.com


_______________________________________________

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: sending msgs to nsoperation threads
      • From: Andreas Grosam <email@hidden>
References: 
 >sending msgs to nsoperation threads (From: Shane <email@hidden>)

  • Prev by Date: Re: sending msgs to nsoperation threads
  • Next by Date: Re: Moderator - Re: iPad 4.2 (deploy to 3.2.2) error
  • Previous by thread: Re: sending msgs to nsoperation threads
  • Next by thread: Re: sending msgs to nsoperation threads
  • Index(es):
    • Date
    • Thread