Note: If you are creating secondary threads using the POSIX thread APIs instead of NSThread, you cannot use Cocoa, including NSAutoreleasePool, unless Cocoa is in multithreading mode. Cocoa enters multithreading mode only after detaching its first NSThread. To use Cocoa on secondary POSIX threads, your application must first detach at least one NSThread, which can immediately exit. You can test whether Cocoa is in multithreading mode with the NSThread class method isMultiThreaded.