19 Mar
2015
19 Mar
'15
6:40 p.m.
On Thursday 19 March 2015 13:24:46 Nevin Liber wrote:
On 19 March 2015 at 13:19, Andrey Semashev
wrote:
On Linux rand() is not thread safe in the sense that its result is not predictable, which is fine.
This sounds suspicious.
Are you sure there are no race conditions inside the implementation of rand()? If there are race conditions, how do you know they are always benign?
I was basing that on the man page. Now I have downloaded glibc sources and can see it uses a lock internally. So yet again, I was wrong. Live and learn...