A function identified as deprecated has been superseded and may become unsupported in the future.
Determines how many threads are available to be allocated in a thread pool. (Deprecated in Mac OS X v10.3. There is no replacement.)
OSErr GetFreeThreadCount ( ThreadStyle threadStyle, SInt16 *freeCount );
The type of thread to get information about. Cooperative is the only type that you can specify. Historically, the Thread Manger supported two types of threads, preemptive and cooperative, but the Thread Manager no longer supports preemptive threads.
On return, a pointer to the number of threads available to be allocated.
A result code. See “Thread Manager Result Codes.”
The number of threads in the pool varies throughout execution of your application. Calls to CreateThreadPool
add threads to the pool and calls to the function NewThread
, when an existing thread is allocated, reduce the number of threads. You also add threads to the pool when you dispose of a thread with the DisposeThread
function and specify that the thread be recycled.
Use the GetSpecificFreeThreadCount
function to determine how many threads of a particular stack size are available.
Active development with the Thread Manager is not recommended. The API is intended only for developers who are porting their applications to Mac OS X and whose code relies on the cooperative threading model. If you are writing a new Carbon application, you should use POSIX threads or the Multiprocessing Services API instead. See Threading Programming Guide for more information.
Threads.h
Determines how many threads with a stack size equal to or greater than the specified size are available to be allocated in a thread pool. (Deprecated in Mac OS X v10.3. There is no replacement.)
OSErr GetSpecificFreeThreadCount ( ThreadStyle threadStyle, Size stackSize, SInt16 *freeCount );
The type of thread to get information about. Cooperative is the only type that you can specify. Historically, the Thread Manger supported two types of threads, preemptive and cooperative, but the Thread Manager no longer supports preemptive threads.
The stack size of the threads to get information about.
On return, a pointer to the number of threads of the specified stack size available to be allocated.
A result code. See “Thread Manager Result Codes.”
The GetSpecificFreeThreadCount
function determines how many threads with a stack size equal to or greater than the specified size are available to be allocated. Use this function instead of GetFreeThreadCount
when you are interested not simply in the total number of available threads but when you want to know the number of available threads of a specified stack size as well.
The number of threads in the pool varies throughout execution of your application. Calls to the function CreateThreadPool
add threads to the pool and calls to the function NewThread
, when an existing thread is allocated, reduce the number of threads. You also add threads to the pool when you dispose of a thread with the DisposeThread
function and specify that the thread be recycled.
To determine how many threads of any stack size are available, use the GetFreeThreadCount
function.
Active development with the Thread Manager is not recommended. The API is intended only for developers who are porting their applications to Mac OS X and whose code relies on the cooperative threading model. If you are writing a new Carbon application, you should use POSIX threads or the Multiprocessing Services API instead. See Threading Programming Guide for more information.
Threads.h
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-04-04)