• 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: Using Darwin headers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Darwin headers


  • Subject: Re: Using Darwin headers
  • From: Chris Purcell <email@hidden>
  • Date: Sun, 23 Jun 2002 11:37:12 +0100

Thank you both for replying. I've not got pthreads.h on my system, and I was trying to make a faster chunk of code than one which uses NSLocks, so alas Vince's suggestions are out; I did turn to atomicity.h (someone else also suggested that on www.CocoaDev.com), but ended up taking their atomic swap and modifying it, since it was not similar enough to the kernel one to be an adequate replacement.

If anyone is curious, I found the asm commands adequately defined at http://usgibm.nersc.gov/alangref/frame8_toc.htm#top_link, which also helpfully had a couple of examples, one of which was the code for OSCompareAndSwap (the function I wanted); look under lwarx or stwcx.

Thanks to everyone.

Kritter out

On Sunday, June 23, 2002, at 02:24 , Vince DeMarco wrote:

pthreads

look at the code in /usr/include/pthreads.h

there are mutexes etc.. there

Or if this is a Cocoa application use NSLock.

vince


On Saturday, June 22, 2002, at 08:54 , Simon Stapleton wrote:

Chris

You're going to have problems here. I also wanted to use the atomicOperations stuff, but you have to be in OS space to use them, I believe. The symbols will be found in mach.kernel...

FWIW, there is Kernel.framework, but including it causes all sorts of problems and, as you noticed, failure to link. I think (but I'm not sure) it only works if you're building a kernel extension.

You'll probably do better to go to gcc3 and use atomicity.h (Part of the c++ library, iirc)

Simon
_______________________________________________
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: Using Darwin headers (From: Vince DeMarco <email@hidden>)

  • Prev by Date: Undefined Linking Symbols
  • Next by Date: Re: Can't get an NSDocument subclass to load nib...
  • Previous by thread: Re: Using Darwin headers
  • Next by thread: Re: Using Darwin headers
  • Index(es):
    • Date
    • Thread