This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Glibc, Pthread, Futexes and malloc


On Fri, Mar 07, 2014 at 03:12:08PM -0500, Antonio Barbalace wrote:
> For a project that I am developing I am using glibc but I should avoid
> to use pthread (nptl).
> 
> The project consist of a modification of the Linux kernel in order to
> create a single image OS on different nodes: threads (not processes!)
> run on a node but also across nodes. Currently we do not have the
> support for futexes. (have a look at www.popcornlinux.org)
> 
> After copy and paste the basic threading functions from pthread, by
> removing futexes, in a new library, cthread
> (http://www.barbalace.it/antonio/projects/cthread.tar.gz) .. I was
> wondering IF:
> 
> - does exist a version of glibc without futex ?!

no.

We are rewriting malloc now, one thing is that locking should not be at
hot path and use atomics for returning memory between threads.

>    - in glibc scoping out malloc and printf how much of the other code
> rely on futex?

We use internal locking (see lowlevellock.h) file mainly to avoid
linking everything with pthread. You could try to replace these with
your primitives.

> - is there any chain of per thread initializers (*_atfork) for nptl
> that I have to take care of?
>    - e.g. is malloc_atfork called after do_clone?
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]