bug-gnulib
[Top][All Lists]
Advanced

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

Re: Lock module improvement


From: Yoann Vandoorselaere
Subject: Re: Lock module improvement
Date: Tue, 29 Jul 2008 16:53:23 +0200

Hi Bruno,

Le mardi 22 juillet 2008 à 01:44 +0200, Bruno Haible a écrit :

> > > > - Implement support for condition variable.
> > > 
> > > You are welcome to contribute a module for this.
> > 
> > I started working on condition variable support. To me, it make sense to
> > do that directly within the lock module (the code is very much similar
> > to what currently exist for mutex primitive). Any objection?
> 
> Yes, I continue to think that it belongs into a different module, because
> 
>   1) For 95% of all multithread programming, all one needs is
>        - locks,
>        - thread-local storage,
>        - starting and joining threads.
>      Wait queues and condition variables are less needed and harder to
>      use correctly (without introducing bugs or deadlocks).
> 
>   2) The 'lock' module is compiled into libintl, and therefore I prefer to
>      avoid increasing its .o file size for things that libintl does not need.

Would it be okay if contrary to the current lock.h module (which define
the various gl_lock_ functions as macros), I use real function? 

Waiting on a condition might return ETIMEDOUT / EPERM, so it'd be
cleaner to do that from real function rather than macro.

Additionally, your current lock.h code still make use of abort() which
I'm reluctant to see in library code. Would you agree to propagate the
error return in case of problem?

-- 
Yoann Vandoorselaere <address@hidden>





reply via email to

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