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: [RFC] powerpc: optimizing random() and POSIX question


* 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


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