• 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: External kill of an NSThread?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: External kill of an NSThread?


  • Subject: Re: External kill of an NSThread?
  • From: "Adam R. Maxwell" <email@hidden>
  • Date: Tue, 21 Nov 2006 20:25:49 -0800


On Nov 21, 2006, at 19:38, Roland Torres wrote:

On Nov 21, 2006, at 6:46 PM, John Stiles wrote:

If he's already willing to spin off a thread to do the work, all he needs to do is wait for the thread to complete.
Why kill the thread early? Just let it take however long it needs, and if the user gets tired of waiting, let them cancel and then sweep up after the thread whenever dataWithContentsOfURL:url returns.


Yes, this makes a lot of sense, especially since it *is* going to timeout eventually. I'll just "abandon" the thread (from the user point of view). When it does complete, I call MPExit() from within the thread, and it's all good.

Why are you calling MPExit() from an NSThread? You'd likely want to use [NSThread exit], but even that shouldn't generally be necessary. Also, ISTR having problems using +[NSData dataWithContentsOfURL:] in a thread to load a file from a web server; it's not clear to me if the underlying mechanism it uses is thread safe.


Adam
_______________________________________________

Cocoa-dev mailing list      (email@hidden)

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: 
 >External kill of an NSThread? (From: Roland Torres <email@hidden>)
 >Re: External kill of an NSThread? (From: John Stiles <email@hidden>)
 >Re: External kill of an NSThread? (From: Filipe Varela <email@hidden>)
 >Re: External kill of an NSThread? (From: Roland Torres <email@hidden>)
 >Re: External kill of an NSThread? (From: Murat Konar <email@hidden>)
 >Re: External kill of an NSThread? (From: Roland Torres <email@hidden>)
 >Re: External kill of an NSThread? (From: Murat Konar <email@hidden>)
 >Re: External kill of an NSThread? (From: Roland Torres <email@hidden>)
 >Re: External kill of an NSThread? (From: Murat Konar <email@hidden>)
 >Re: External kill of an NSThread? (From: Roland Torres <email@hidden>)
 >Re: External kill of an NSThread? (From: Murat Konar <email@hidden>)
 >Re: External kill of an NSThread? (From: John Stiles <email@hidden>)
 >Re: External kill of an NSThread? (From: Roland Torres <email@hidden>)

  • Prev by Date: Re: Questions for implementing pop-up contextual menus for Ctrl-Click and Right-Click
  • Next by Date: Your information [:.VIRUS.:]
  • Previous by thread: Re: External kill of an NSThread?
  • Next by thread: Re: External kill of an NSThread?
  • Index(es):
    • Date
    • Thread