This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [MTASCsft PATCH WIP5 01/33] Multi Thread, Async Signal and Async Cancel safety documentation: intro
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Torvald Riegel <triegel at redhat dot com>
- Cc: libc-alpha at sourceware dot org, carlos at redhat dot com, mtk dot manpages at gmail dot com
- Date: Sat, 23 Nov 2013 11:15:59 -0200
- Subject: Re: [MTASCsft PATCH WIP5 01/33] Multi Thread, Async Signal and Async Cancel safety documentation: intro
- Authentication-results: sourceware.org; auth=none
- References: <20131113081059 dot 3464 dot 51385 dot stgit at frit dot home> <20131113081132 dot 3464 dot 30409 dot stgit at frit dot home> <1384859432 dot 32326 dot 364 dot camel at triegel dot csb> <orsiurva0g dot fsf at livre dot home> <1384956325 dot 3152 dot 591 dot camel at triegel dot csb>
On Nov 20, 2013, Torvald Riegel <triegel@redhat.com> wrote:
> What about linking statically and using LTO?
I've added the following to the definition of MT-Safe. Does it address
satisfactorily the issues you brought up in this regard?
A function being MT-Safe does not imply any form of synchronization,
nor that any combination of calls of MT-Safe functions would be
regarded as MT-Safe. For example, having a thread call two MT-Safe
functions one right after the other does not guarantee behavior
equivalent to atomic execution of a combination of both functions,
since concurrent calls in other threads may cause behavior to diverge.
In some cases, even expanding MT-Safe functions inline could cause
combinations to become MT-Unsafe due to reordering that this could
enable; this is never the case of @glibcadj{} functions defined in
user-visible headers, because these are meant to be inlined, but it
may be for functions that are exported by @glibcadj{} shared
libraries; whole-program optimizations that might inline functions
across library interfaces might expose this sort of problem, so
performing inlining across the @glibcadj{} interface is not
recommended, nor is the documented MT-Safety status guaranteed under
such arrangements.
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist Red Hat Brazil Compiler Engineer