[concurrency-interest] Re: SynchronizedLong vs. other locks

Dawid Kurzyniec dawidk at mathcs.emory.edu
Fri Jul 8 10:27:59 EDT 2005


Aleksey Gureev wrote:

>Dawid,
>  
>
>:) You forget about the time zones.
>  
>
Yes I did. How about:

private static final TimeZone local = TimeZone.getDefault();

private static long getTomorrowTime() {
    long current = System.currentTimeMillis();
    long offset = local.getOffset(current);
    return (((current + offset + DAY)/DAY)*DAY - offset;
}

Now I'm less sure if this will be faster than shared volatile, but it's 
worth a shot.

Regards,
Dawid



More information about the Concurrency-interest mailing list