From: Daniel A. S. <st...@ic...> - 2005-04-28 07:53:11
|
On 28/04/2005, at 17:21, Zoran Vasiljevic wrote: >> AFAIU the libSystem spinlock API immediately yields on a single >> processor, and spins very briefly on a multiprocessor and then >> yields. Certainly all of CoreFoundation uses spinlocks for locking... > > Ah... I'd have to look into that. So, they spin but after some quantum > go sleep? > I thought they were pure spin locks (just spinning, no yielding)... I > will look into > this. Yes, this would mean improvements on MP machines (perhaps Apple > will do more > MP machines now they rearranged the kernel to be more granular)... the implementation on 10.3 is here: http://darwinsource.opendarwin.org/10.3/xnu-517/osfmk/ppc/commpage/ spinlocks.s I don't know if this has changed on 10.4 as you can see, spinlock_32_lock_up immediately relinquishes, whereas spinlock_32_lock_mp spins 1000 times before relinquishing the current thread, same for the 64 bit versions. > So. lets dig into it. If I come against something suspicious, I'll let > you > know. This change won't require a TIP I suppose, also no stub-changes? no, not for the third option, that's one of its advantages. The other two change proposals would also only require changes to the internal stubs tables, so no TIP BTW, I have committed the tkMacOSXNotify.c changes that just sync it with tclUnixNotfy.c, so the patches probably no longer apply cleanly, I will update them ASAP; or you can apply to the tree from before 25-4 Cheers, Daniel -- ** Daniel A. Steffen ** "And now for something completely ** Dept. of Mathematics ** different" Monty Python ** Macquarie University ** <mailto:st...@ma...> ** NSW 2109 Australia ** <http://www.maths.mq.edu.au/~steffen/> |