mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: Pending issues for next release
Date: Tue, 2 Apr 2013 14:09:36 -0400	[thread overview]
Message-ID: <20130402180936.GP20323@brightrain.aerifal.cx> (raw)
In-Reply-To: <1364902974.3629.179.camel@eris.loria.fr>

On Tue, Apr 02, 2013 at 01:42:54PM +0200, Jens Gustedt wrote:
> Hi,
> 
> is there a schedule for C11 thread interfaces? I have a shallow
> wrapping of C11 threads via pthread in P99, but because of the
> different calling conventions for the user's start function (return of
> int instead of void* ) this is sort of suboptimal (read crude).

The easiest way to hack it on is to use a fixed start-function and
malloc a block for the C11 thread identifier that contains the
caller's start function and argument and space for the return value,
then pass that to the start-function. But I agree this is ugly and
bloated.

> Having scanned through the musl sources, I don't think that supporting
> C11 threads would be a big deal. Some additional wrappers should
> suffice, I think.

The main difficulty is respecting the namespace. Some functions would
need to be renamed to be in the reserved namespace with aliases for
their POSIX names.

> I have seen Rich's mail to glibc asking for the size of some data
> structures, but I have the impression that this has stalled and that
> there is no reply to be expected soon.

Yes...

> I understand that musl wants to
> be ABI compatible, but I don't see anything that can't be fixed
> immediately, once they ship a version of C11 threads. I would expect

This should probably be discussed in a bit more detail. Obviously
there's the C++ ABI issue (underlying struct tags) but we haven't
addressed that at all anyway. The ABI issues in terms of struct size
do not actually affect the app-to-libc ABI at all; they just affect
the ABI between object files compiled using musl's headers.

> any sane implementation that supports pthread and C11 thread
> simultaneously not to change the ABI for the native C interface just
> for the fun of it.

I'm not sure what you mean by "change". The ABI isn't defined yet.
There's clearly a choice to be made between making the C11 objects
lighter, since they don't have to provide as much functionality, and
making them just duplicates of the POSIX objects (so that code can be
shared for both), and it's not clear which is better.

Even if the objects are shared, we may choose not to share code if it
allows the C11 synchronization primitives to have better performance
than the POSIX ones.

Rich


  reply	other threads:[~2013-04-02 18:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-01 23:31 Rich Felker
2013-04-02 11:11 ` Szabolcs Nagy
2013-04-04 23:37   ` Rich Felker
2013-04-05  0:41     ` Rich Felker
2013-04-05  0:48     ` Isaac Dunham
2013-04-02 11:42 ` Jens Gustedt
2013-04-02 18:09   ` Rich Felker [this message]
2013-04-02 19:40     ` Jens Gustedt
2013-04-03  1:37       ` Rich Felker
2013-04-04  4:00 ` Isaac Dunham
2013-04-04 23:04   ` Rich Felker
2013-04-09 17:19     ` Rich Felker
2013-04-04 23:28 ` Rich Felker
2013-04-06 21:28 ` Update (Re: [musl] Pending issues for next release) Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130402180936.GP20323@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).