Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Mar 2007 21:29:38 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        deeptech71@gmail.com
Cc:        freebsd-chat@freebsd.org
Subject:   Re: 64bit timestamp
Message-ID:  <20070326182938.GA18096@kobe.laptop>
In-Reply-To: <4607D66B.4070800@gmail.com>
References:  <200703251900.l2PJ0Z8w058298@lurza.secnetix.de> <4606D88E.4080503@gmail.com> <20070325215731.GA1517@kobe.laptop> <4607D66B.4070800@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2007-03-26 16:19, deeptech71@gmail.com wrote:
>Giorgos Keramidas wrote:
>>On 2007-03-25 22:16, deeptech71@gmail.com wrote:
>>> Actually, my intend wasn't to use it in filesystems, but
>>> server-client apps, such as games, where 32bit integer timers
>>> must be restarted every 3 weeks
>>
>> That's a bug in the applications themselves.  The
>> gettimeofday() call in any modern UNIX returns a `struct
>> timeval', which contains *both* a time_t value of the current
>> time with second-level accuracy and a tv_usec member with
>> millisecond accuracy (or at least an approximation of a
>> timestamp with millisecond accuracy).
>>
>> Any userlevel application which uses userlevel time counters
>> and requires a restart every two or three weeks, because these
>> userlevel timecounters have rolled back to zero, is broken and
>> should be fixed.
>
> No, it's not a bug, the server and client communicates with
> lots of packets timestamped with a synchronized time, and
> sending 64bit timestamps would be too much bandwidth
> consuming. There's a restart demand every hour or so, so it's
> not a problem... but the server is limited for max 3 weeks.

Well, if timestamps are required and the bandwidth is not enough
to send 128 bits of timestamp data every few nanoseconds, then
the operating system cannot do a lot of things to help.

The best the OS can do is provide you *locally* with extra-fine
timestamps, and let a smart algorithm of time synchronization
between the two remote hosts handle the rest.  It's not going to
be easy, but someone has to do the "hard work" :)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070326182938.GA18096>