Re: sending msgs to nsoperation threads
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