Skip to content

Instantly share code, notes, and snippets.

@hozumi

hozumi/bench.clj Secret

Created May 7, 2011 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hozumi/3048d90328d3118583a4 to your computer and use it in GitHub Desktop.
Save hozumi/3048d90328d3118583a4 to your computer and use it in GitHub Desktop.
bench
We couldn’t find any files to show.
@hozumi
Copy link
Author

hozumi commented Jul 31, 2011

STMは共有資源に複数のスレッドが書き込みを試みて、共有資源が他のスレッドに既に更新されてれば失敗してやり直すという処理なので、逆に言えば、実行中のスレッドの中の必ず一つは書き込みに成功するということだと思います。
実行中のどの時間を見ても必ず書き込みに成功するスレッドが一ついるということはつまり、
原理的にはシングルスレッドと同じ時間で処理できることを意味していると思います。
シングルスレッドやロック(hash-bench)の時は使われていなかったコアが無駄な計算をするだけで、
処理にかかる時間が劇的に伸びるのはどうもよく理解出来ないです。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment