• 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: -forceCancel an NSOperation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >-forceCancel an NSOperation (From: Carl Hoefs <email@hidden>)

  • Prev by Date: -forceCancel an NSOperation
  • Next by Date: Re: -forceCancel an NSOperation
  • Previous by thread: -forceCancel an NSOperation
  • Next by thread: Re: -forceCancel an NSOperation
  • Index(es):
    • Date
    • Thread