Y
Hacker News
new
|
ask
|
show
|
jobs
by
foota
82 days ago
Just curious, why? Is this true even if you did something like a per-CPU histogram that uses atomic ops to increment?
1 comments
jeffbee
82 days ago
If you have a per-cpu metric there would not be a reason to use atomic instructions to mutate it.
link
loeg
82 days ago
In general your unpinned userspace threads will hit the same CPU 99.99% of the time, but not 100%.
link
jeffbee
82 days ago
Sure. You get the pointer, you lock the mutex, 99.99% of the time that is uncontended, then you set all the metrics and release it.
link
loeg
82 days ago
Taking the mutex uses (uncontended) atomic ops.
link