This is the mail archive of the libc-alpha@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: Dummy pthread functions in libc considered harmful


On 08/25/2015 03:01 PM, Alexander Monakov wrote:
> On Tue, 25 Aug 2015, Ondřej Bílka wrote:
>> As we internally already have SINGLE_THREAD_P optimization we should use 
>> that optimization for all atomics and locks and get slower path only
>> when there is some thread created.
>>
>> We could export that variable for gcc to also speed up atomics.
> 
> It's not possible to use "current process is single-threaded" predicate to
> optimize atomics: they might be operating on shared memory.

Such mutexes must be marked as process-shared, and therefore, the
optimization could be skipped for them, I think.

-- 
Florian Weimer / Red Hat Product Security


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