in reply to Re^2: Solaris + UltraSparc T2 + Threads: Avoid LCK's
in thread Solaris + UltraSparc T2 + Threads: Avoid LCK's
But one could certainly imagine a (less than ideal) pseudo-random number generator implementation that uses locks to protect shared state.
I agree.
What is crazy is blaming rand, when in the data he posted, the code that ran rand in tight loops on 64 threads, showed no locking symptoms, but the version that interspersed each call to rand with a 100k assignments did.
A conservative test shows the former making ~700,000 calls to rand per second, the latter 105/sec. If either was going to suffer lock contention, you'd expect it to be the former.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Solaris + UltraSparc T2 + Threads: Avoid LCK's
by RMGir (Prior) on Apr 24, 2009 at 13:10 UTC |