• 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: Cocoa objects in pthreads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Cocoa objects in pthreads (From: Finlay Dobbie <email@hidden>)

  • Prev by Date: Re: A mystery with NSFileManager
  • Next by Date: Re: Distributed Objects
  • Previous by thread: Re: Cocoa objects in pthreads
  • Next by thread: Re: PB/IB things that have stopped working
  • Index(es):
    • Date
    • Thread