[libc-commits] [libc] [libc] Make 'rand()' thread-safe using atomics instead of TLS (PR #96692)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Wed Jun 26 08:55:24 PDT 2024


jhuber6 wrote:

> > And even then, should we really make this MT-unsafe if the atomics aren't fast?
> 
> I can forsee primitive microcontrollers which are single threaded wanting to make use of `rand`, and not caring about MT safety.

Yeah, what's the preferred way to handle this? I'd say just an option for baremetal, but even that might have some MT targets.

https://github.com/llvm/llvm-project/pull/96692


More information about the libc-commits mailing list