Re: Cocoa objects in pthreads
Re: Cocoa objects in pthreads
- Subject: Re: Cocoa objects in pthreads
- From: Chris Kane <email@hidden>
- Date: Sat, 23 Feb 2002 17:35:36 -0800
To elaborate, Cocoa does not become multithread-safe, insofar as it is,
until the first NSThread is spawned off. This is to avoid the overhead
of locking for single-threaded apps, and detaching the first new
NSThread is the trigger.
NSThreads are built atop pthreads, however, so pthread properties you
can set after creation can be set inside an NSThread.
Chris Kane
Cocoa Frameworks, Apple
On Thursday, February 21, 2002, at 11:13 AM, Finlay Dobbie wrote:
On Wednesday, February 20, 2002, at 08:01 PM, Luke Bellandi wrote:
We've got an application that needs to use pthreads because we set the
thread policy and priority (otherwise we'd probably use NSThread.)
NSThread basically is a wrapper around pthreads. I think you should be
able to get the current thread after you detach an NSThread using the
standard pthread APIs and set the policy and priority that way. You
should probably use NSThread because that way threading is enabled in
various Foundation classes etc.
-- Finlay
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.