bug-gnulib
[Top][All Lists]
Advanced

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

Re: dependency creep: cond


From: Bruno Haible
Subject: Re: dependency creep: cond
Date: Mon, 17 Nov 2008 23:47:07 +0100
User-agent: KMail/1.5.4

Hi Sam,

> why does the cond module depend on
> 
> errno
> stdbool
> time
> gettimeofday

It depends on
  - errno because glthread_cond_timedwait may return ETIMEDOUT, an errno
    value which is missing on some systems,
  - stdbool because gl_cond_timedwait returns a boolean value,
  - time because of 'struct timespec', used for timeout arguments,
  - gettimeofday because the implementation on Windows needs to get the
    current time.

All these modules are pretty low complexity: stdbool and time don't compile
.c files, gettimeofday is only really used on mingw IIRC, and errno is cheap
too.

> I expected it to be similar to threadlib and lock in that it unifies the 
> existing system functionality under a uniform API

This is a misunderstanding about 'threadlib'. 'threadlib' does not provide
any standardized functionality, it only delegates to the system. It consists
only of autoconf macros that allow the user to choose the thread
implementation to use.

> is it possible to have a package condlib similar to threadlib which will not 
> pull anything extra?

Why would you want that? gnulib-tool assembles the needed files and Makefile.ams
in a couple of seconds, and the resulting code footprint of the 4 mentioned
modules is small.


Alternatively, if you don't like the way gnulib is done, then, instead of
using the lock, tls, cond, thread modules from gnulib, you can also use
the POSIX threads API directly, and - for Windows portability - use the
pthreads-win32 package [1].

Bruno

[1] http://sourceware.org/pthreads-win32/





reply via email to

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