|
From: Matthias W. <mat...@in...> - 2002-11-16 17:43:28
|
On Fri, Nov 15, 2002 at 07:22:35PM -0800, Josh Green wrote: > > AFAIK there are no r/w locks in the current linuxthread implementation. > > I read about plans to include those in connection with the NPT (native > > posix threads). > > > > matthias > > > > What about pthread_rwlock_t (you can see this in > /usr/include/pthread.h). I notice that the function prototypes are > surrounded by an "#ifdef __USE_UNIX98" which I'm unfamiliar with. I can > do a "p sizeof (pthread_rwlock_t)" in gdb with a pthread linked program, > so it seems to be available (32 bytes a mutex, not bad I guess). Cheers. > Josh Green I played around with this when I needed 'pthread_mutexattr_settype' and found out that I had to define #define _XOPEN_SOURCE 600 before the first system include in my code; this will set some other defines in /usr/include/features.h . I have to note that lots of basic types (I guess one of it was size_t) got screwed up so I had to drop it again. Besides, I'd try to use atomic types and atomic read/writes to avoid locking wherever possible. matthias |