Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trylocks in the kernel



On 15/12/2005, at 7:03 AM, email@hidden wrote:

On Dec 13, 2005, at 9:21 AM, Brian Bergstrand wrote:

On Dec 13, 2005, at 12:23 AM, Ryan McGann wrote:

The new Tiger locking KPIs seem to lack a trylock variant for any
of the lock types (mutex, spinlock, read/write).

A mutex try variant is available in the Unsupported KPI. It's probably safe to use this for 8.0, but may break in the next major release.

All of the try variants are in the kernel proper, so one has to
wonder why they are not exported in the KPI.
Well they also have a way to promote read-write locks to exclusive
from shared exported in the kernel, but not in the KPIs
(lck_rw_exclusive_to_shared and lck_rw_shared_to_exclusive). That bug
was closed :-( It would be really nice to have those KPIs back in the
supported list, if anybody is listening...

Hear Hear.

Amongst the 30 kernel symbols we need that are preventing us from using the 10.4 KPI I see the following locking functions:

_lck_mtx_try_lock
_lck_rw_done
_lck_rw_lock_exclusive_to_shared_gen
_lck_rw_try_lock_exclusive
_lck_rw_try_lock_shared
_lck_spin_try_lock

My bugs have been marked "Duplicate", so someone's aware of the issue. All the same I think we need to push this at WWDC next year. A locking API that doesn't export try functions and requires you to keep track of whether an rwlock is held shared or exclusive when you unlock it simply isn't complete in my opinion.

Sam
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.