[infinispan-dev] ClockService

Mircea Markus mmarkus at redhat.com
Tue Jan 29 13:27:43 EST 2013


On 29 Jan 2013, at 17:45, Manik Surtani wrote:

> 
> On 29 Jan 2013, at 17:17, Bela Ban <bban at redhat.com> wrote:
> 
>> 
>> On 1/29/13 5:25 PM, Sanne Grinovero wrote:
>>> Glad you started work on that :)
>>> 
>>> Any currentTimeMillis() even today will blow away your cache line and
>>> probably trigger a context switch.
>> 
>> I understand the context switch (in general, it's not recommended anyway 
>> to invoke a system call in synchronized code), but I fail to see why 
>> this would blow the cache line. Are you referring to the cached Date 
>> value here ?
> 
> No, if you have a separate maint thread that updates a reusable currentTimeMillis value.

I guess Bela's question was about why System. currentTimeMillis() would trigger a context switch, I'm also curious about that one :-) 

> 
> Do you use nanoTime() a lot then?  Because that too is inefficient (as per the Oracle blog) ...
> 
> --
> Manik Surtani
> manik at jboss.org
> twitter.com/maniksurtani
> 
> Platform Architect, JBoss Data Grid
> http://red.ht/data-grid
> 
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

Cheers,
-- 
Mircea Markus
Infinispan lead (www.infinispan.org)




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20130129/4ac59e3a/attachment-0001.html 


More information about the infinispan-dev mailing list