cross-thread locking
Dag-ErlingSmørgrav
des at des.no
Fri Feb 20 14:24:37 PST 2004
Daniel Eischen <eischen at vigrid.com> writes:
> Found it. It's in the Rationale -> System Interfaces -> General Info.
> Here's a link that might get you there:
>
> http://www.opengroup.org/onlinepubs/007904975/xrat/xsh_chap02.html#tag_03_02_09
OK. It seems to me then that our spin locks are only superficially
conformant. They are far heavier than the rationale suggests: they
depend on malloc(), and they call pthread_self() which requires a full
libpthread initialization. That makes them unsuitable in many cases.
For instance, a malloc() implementation can't use our spin locks to
protect its management structures. This happens to be a very real
issue for me in my day job; I ended up writing my own spin lock
implementation based solely on <machine/atomic.h> (anyone know of a
good way to thoroughly test it, BTW?)
DES
--
Dag-Erling Smørgrav - des at des.no
More information about the freebsd-threads
mailing list