Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: Reusing threads



On Wed, 27 Feb 2002 18:43:48 -0600, "Jeff Evans" <email@hidden>
wrote:
> Hello, I have a Carbon app that regularly downloads the same file from an
> ftp server (always has to have the most recent version) using URLAccess, and
> I noticed when I debugged it that when the app downloads the file, it spawns
> about 20 threads, including the one I created to make the actual call to
> URLDownload(). After it gets the file, the threads end, but the next time
> my app downloads the file, the 20 new threads have id's starting with one
> more than the last thread created (e.g. 101-120, 121-142, etc...). I
> watched the thread id grow to the thousands, and wondered if my app should
> be reusing threads, since it's running the same thread code everytime.
> Also, I wondered if eventually my app would crash once the thread id type
> overflowed. I'm creating my thread with the kCreateIfNeeded option, but saw
> a kUsePremadeThread option and wondered if I should be using that so my app
> will use the same threads. I appreciate anyone's help.

Not necessary. The thread manager should reuse the old id's without any
problem.
--
Enjoy,
George Warner,
Mixed Mode Magic Fragment Scientist
Apple Developer Technical Support (DTS)
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.