[RFC] powerpc: optimizing random() and POSIX question

Florian Weimer fweimer@redhat.com
Tue Feb 11 14:43:00 GMT 2020


* 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



More information about the Libc-alpha mailing list