Re: -forceCancel an NSOperation
Re: -forceCancel an NSOperation
- Subject: Re: -forceCancel an NSOperation
- From: Ken Thomases <email@hidden>
- Date: Wed, 01 Mar 2017 16:32:25 -0600
On Mar 1, 2017, at 4:23 PM, Carl Hoefs <email@hidden> wrote:
>
> The NSOperation -cancel and NSOperationQueue -cancelAllOperations methods merely set a property that needs to be periodically and cooperatively checked and acted upon by the receiving NSOperation.
>
> Normally, that is sufficient. But under some circumstances, it's possible for an executing NSOperation to get hung up doing I/O or for some other reason. No means is given to forcibly stop the execution of an NSOperation, and there's no -thread method to obtain its thread and terminate it.
>
> Does GCD allow this level of introspection and control of executing blocks?
No. In general, you can't reliably and safely terminate a thread from outside of that thread. That's why NSOperation works the way it does.
Regards,
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