• 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: waiting on a thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: waiting on a thread


  • Subject: Re: waiting on a thread
  • From: Dennis Falling <email@hidden>
  • Date: Mon, 13 Dec 2004 11:32:47 -0600

Yeah, I was just not wanting to have to pass even more arguments to my thread. I'll just overcome my laziness and pass the necessary info to let my thread delete the files.

Thanks,
-dennis


On Dec 13, 2004, at 10:58 AM, Fritz Anderson wrote:

Spawning a thread, and then doing nothing until the thread completes, is the same thing as calling the thread's main procedure without bothering with a thread. Yes, it defeats the purpose of having a thread.

I gather your main thread of execution is done with your files once it has handed them off to the processing thread. Why not have the processing thread take ownership of those files, and delete them itself when it is done?

If it's more complicated than that, you'll have to work out some sort of reference-counting scheme for the files, deleting when the count goes to zero. (But the increment for the processing thread's claim would have to be made before that thread is started.)

	-- F

On 13 Dec 2004, at 10:17 AM, Dennis Falling wrote:

Is there any way to have a method spawn a thread, then wait for that thread to end before continuing with other calls in that method? Does this negate the purpose of threads? Basically, I'm calling a method which will use a few files, and then deleting those files in the calling method. However, since the method call is a new thread, I'm deleting the files before that thread ever gets to them. Ideas?

 --
Fritz Anderson
Consulting Programmer				Chicago, Illinois
http://resume.manoverboard.org/


_______________________________________________ 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: 
 >waiting on a thread (From: Dennis Falling <email@hidden>)
 >Re: waiting on a thread (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: Kill other process's warning dialog
  • Next by Date: Re: Trouble reading a binary file.
  • Previous by thread: Re: waiting on a thread
  • Next by thread: Best way to email html?
  • Index(es):
    • Date
    • Thread