• 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: Correct way to force kill a thread.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Correct way to force kill a thread.


  • Subject: Re: Correct way to force kill a thread.
  • From: Mark Lively <email@hidden>
  • Date: Tue, 21 Jun 2005 13:45:03 -0400

I have limited experience with libcurl but as I recall you provide the curl send with a read function or a write function. The function can then check a flag that you set the next time it is told to read/ write and then return an error.

take a look at the flags CURLOPT_READFUNCTION and CURLOPTWRITEFUNCTION

On Jun 21, 2005, at 1:27 PM, John Stiles wrote:

There is no way to force-kill a thread cleanly. You will leak memory, objects, network connections, etc. OTOH, you can force-kill a separate process cleanly and they are not expensive to create.

You should consider finding a different API that works asynchronously instead of synchonously--I don't know libcurl, but if it only has a synchronous API, it might not be good enough for your needs. I have used the NSURL APIs and they are very flexible and easy to cancel mid-flight. I had really good luck with them so you might want to give it a shot.


On Jun 21, 2005, at 10:04 AM, Ben D. Jones wrote:

I am using CURLHandle (libcurl) in my program. The actual upload happens in a seperate thread, and I need the ability to kill that thread if the user hits cancel. This is made difficult because when you tell CURLHandle to prepareAndPerformCurl locks the thread its in. Any ideas?
_______________________________________________
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


  • Follow-Ups:
    • Re: Correct way to force kill a thread.
      • From: "Ben D. Jones" <email@hidden>
References: 
 >Correct way to force kill a thread. (From: "Ben D. Jones" <email@hidden>)
 >Re: Correct way to force kill a thread. (From: John Stiles <email@hidden>)

  • Prev by Date: Re: NSTreeController - please help, can't see the forest for the tree controller
  • Next by Date: Re: NSTreeController - please help, can't see the forest for the tree controller
  • Previous by thread: Re: Correct way to force kill a thread.
  • Next by thread: Re: Correct way to force kill a thread.
  • Index(es):
    • Date
    • Thread