• 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: Killing a stuck NSThread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Killing a stuck NSThread


  • Subject: Re: Killing a stuck NSThread
  • From: Tom Marchand <email@hidden>
  • Date: Wed, 26 Apr 2006 18:45:20 -0400

How about performing the network operation with a non-blocking operation?

On Apr 26, 2006, at 2:56 PM, Dustin Wenz wrote:

I have an application that spawns an NSThread to perform a blocking network operation. Sometimes the operation takes too long to execute and needs to be cancelled or killed by the main thread.

There was a discussion earlier this month about doing something similar to this with NSThreads. The solution then was to send a signal to the thread to have it terminate gracefully. Unfortunately, since my thread is busy waiting for something, it has no way of receiving such a signal.

I've tried obtaining a pthread id from the NSThread and doing a pthread_kill() on it. For some reason though, calling pthread_self () in the child thread actually gets the id for the main thread, so I have no way to find the id for the child in order to kill it. Are there any other solutions for this?

	- .Dustin

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40comcast.net


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Killing a stuck NSThread (From: Dustin Wenz <email@hidden>)

  • Prev by Date: Re: NSError: why returned directly?
  • Next by Date: break (was: NSError: why returned directly?)
  • Previous by thread: Re: Killing a stuck NSThread
  • Next by thread: temporarily disabling undo
  • Index(es):
    • Date
    • Thread