[concurrency-interest] ThreadLocal vs ProcessorLocal

Nathan Reynolds nathan.reynolds at oracle.com
Wed Oct 17 19:06:07 EDT 2012

The Linux kernel will synchronize the TSC at boot.  The synchronization 
causes the TSC to appear identical.  I say appear because they can only 
synchronize to the point where communication latencies between 
processors makes the values appear to be identical.  You do have to run 
with a "modern" kernel.  Several different Oracle teams have asked the 
Intel architects to figure out a way to make sure TSC stays in sync.  It 
is a very difficult problem to solve cheaply.

Another problem is that older Intel processors would slow down the 
increment rate of TSC when the processor slowed down its frequency.  
This would cause the TSC to not be synchronized.  More recent processors 
have a "const TSC" so that processor frequency changes don't impact TSC 
increment rate.

Nathan Reynolds 
<http://psr.us.oracle.com/wiki/index.php/User:Nathan_Reynolds> | 
Consulting Member of Technical Staff | 602.333.9091
Oracle PSR Engineering <http://psr.us.oracle.com/> | Server Technology
On 10/17/2012 3:26 PM, Mark Thornton wrote:
> On 17/10/12 22:55, Jacy Odin Grannis wrote:
>> One easy way you can see
>> this is System.nanoTime will suddenly start returning wildly different
>> values.  nanoTime is only consistent on a single processor, it can
>> vary widely between processors (at least on Linux).
> I didn't think that was supposed to happen (on a properly configured 
> machine). During the boot process on my systems the kernel checks to 
> see if the TSC is consistent between cores before selecting it for use 
> (and otherwise uses something else).
> Mark
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20121017/c5e9cf41/attachment-0001.html>

More information about the Concurrency-interest mailing list