|
|
|
|
|
by pkolaczk
4610 days ago
|
|
Uncontended interlocked operation is typically about 100-300 CPU cycles. Uncontended mutex is about 30x-50x that. If
there is contention, multiply everything by another 100x.
Additionally these instructions impact not only the calling thread but also other threads by forcing cache synchronization. Therefore a relatively simple operation like pointer assignment can be one cycle when using GC and a hundred to several thousands cycles when using refcounting. Sometimes you can ignore this overhead, sometimes not - depends on how often you do that. http://software.intel.com/en-us/articles/choosing-between-sy... |
|