[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read-write locks

From: Bruno Haible
Subject: Re: read-write locks
Date: Fri, 06 Jan 2017 15:08:59 +0100
User-agent: KMail/4.8.5 (Linux/3.8.0-44-generic; KDE/4.8.5; x86_64; ; )

Torvald Riegel wrote:
> What are the rwlock users, actually?  A web search for gl_rwlock_t seems
> to only turn up lock.h, but no users (unlike gl_lock_t, for example).

You're right, there are no users so far. But there may be in the future:

Gnulib occasionally grabs some piece of code from glibc and makes it available
on non-glibc systems.

Many of the gnulib modules need to be multithread-safe. (For example, module
'fstrcmp' needs to be, because GNU gettext invokes it from within an OpenMP-
parallelized region.)

glibc uses an internal API <libc-lock.h> for its locking. It defines normal
locks, rwlocks, recursive locks, and once-only control. Since this is what
glibc code needs, in general, this is what the gnulib module 'lock' provides.

And the test-lock.c code tests it, because it is good practice, in gnulib,
to provide unit tests.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]