[Openmcl-devel] Quick HW question...
dlw at itasoftware.com
Wed Nov 17 13:32:17 CST 2010
Derrell Piper wrote:
>> (block got-lock
>> (dotimes (i *spin-lock-tries*)
>> (if (%store-conditional something somewhere)
>> (return-from got-lock t)))
> Not sure if this was pseudo-code or not, but...
> A trick I've seen used is to do a non-interlocked test of the spinlock
> before even trying the %store-conditional.
You might want to check this out:
There are hazards here which might possibly be
analogous to what you're doing, but I don't know.
> The non-interlocked test
> will (mostly) avert the expensive %store-conditional when there's
> spinlock contention. Depending upon your locking characteristics, this
> can be a huge win. We used this in the VMS operating system where we
> had a hierarchy of locks that had to be acquired in a particular order,
> though it's applicable in the general case too.
> Might be worth profiling...
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Openmcl-devel