On 6 October 2014 11:22, Bernd wrote:
> Dont worry, currentTimesMillis does not step backward if the timezone
> changes automatically, as it is in UTC time.
>
> However it does jump if somebody manually corrects the time (or allows NTP
> zu jump the time). Both operations are however a general pro
Dont worry, currentTimesMillis does not step backward if the timezone
changes automatically, as it is in UTC time.
However it does jump if somebody manually corrects the time (or allows NTP
zu jump the time). Both operations are however a general problem on Java
servers, should be avoided.
If you
Hi,
Jacopo Cappellato wrote:
>
> On Oct 6, 2014, at 2:31 AM, sebb wrote:
>
>>> The only way to do it is to make
>>> lastReturnTime field thread-safe using locks.
>>
>> Volatile does make the field thread-safe.
>> It's just a question of whether the JVM can re-order the statements
>> when vola
On Oct 6, 2014, at 2:31 AM, sebb wrote:
>> The only way to do it is to make
>> lastReturnTime field thread-safe using locks.
>
> Volatile does make the field thread-safe.
> It's just a question of whether the JVM can re-order the statements
> when volatile is used.
I think Xavier's comments ar
On 5 October 2014 23:39, Xavier Detant wrote:
> Hello,
>
> I'm afraid the fix is wrong since, as Bernd said, no JMM property is used.
> The JVM is allowed to reorder statments and inlining statments.
I'd forgotten about re-ordering.
> The volatile keyword assure you to have the most «fresh» valu
Hello,
I'm afraid the fix is wrong since, as Bernd said, no JMM property is used.
The JVM is allowed to reorder statments and inlining statments.
The volatile keyword assure you to have the most «fresh» value at the
moment of the reading, but since the System.currentTimeMillis() has no side
effect
On 5 October 2014 13:13, Bernd wrote:
> Hmm,
>
> I am not sure about this, the local variable fetch does not use any
> property of the Java Memory Model to make it gurantee to work.
That's not the issue - see my recent update to the JIRA.
> I would
> simply return 0 if the difference is negative
Hmm,
I am not sure about this, the local variable fetch does not use any
property of the Java Memory Model to make it gurantee to work. I would
simply return 0 if the difference is negative. And of course making the
last used value volatile.
Greetings
Bernd
BTW: for what is that idle time used?