This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC] powerpc: optimizing random() and POSIX question
- From: Florian Weimer <fweimer at redhat dot com>
- To: Raphael M Zinsly <rzinsly at linux dot ibm dot com>
- Cc: libc-alpha at sourceware dot org, Tulio Magno Quites Machado Filho <tuliom at linux dot ibm dot com>, Paul Clarke <pc at us dot ibm dot com>
- Date: Tue, 11 Feb 2020 15:42:43 +0100
- Subject: Re: [RFC] powerpc: optimizing random() and POSIX question
- References: <2b9bee0c-ffa0-f7cd-4333-0ef28971b955@linux.ibm.com>
* Raphael M. Zinsly:
> If I remove the lock in order to use lqarx/stqcx to access fptr and
> rptr (that are adjacents), then compute the result as is done in
> random_r, will this still be compliant with POSIX?
I think POSIX requires random to the thread-safe in the presence of
concurrent initstate calls. Would your change preserve this property?
This means that random in other threads would either produce values from
the new sequence, or from the old sequence. But not values that are
part of neither sequence.
Thanks,
Florian