This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: __libc_single_threaded design (was: Re: libpthread removal project)
On 07/10/19 2:05 pm, Szabolcs Nagy wrote:
> __libc_single_threaded can be implemented such that
> its value only changes when the application is
> single threaded, which means normal non-atomic read
> access is valid, it can be a plain _Bool or int
> and it's 100% reliable when the read value is 1.
>
> a thread count variable can change asynchronously
> so users need atomic access, possibly requiring
> libatomic to get linked in even if it's only used
> for single-thread check, and if the value is >1
> the meaning is unclear since it can change async.
That's a good point. More reason for me to drop this line of thought :)
Siddhesh