Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Aug 1998 12:09:48 +0200 (MET DST)
From:      Willem Jan  Withagen <wjw@surf.IAE.nl>
To:        hackers@FreeBSD.ORG
Subject:   Generating unique timestamps (Was: Re: proposal to not change time_t)
Message-ID:  <199808221009.MAA13812@surf.IAE.nl>
In-Reply-To: <199808211810.LAA05293@pau-amma.whistle.com>
References:  <l03130300b203323fc2e9@[208.2.87.13]>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <199808211810.LAA05293@pau-amma.whistle.com> you write:
>>Date: Fri, 21 Aug 1998 09:35:51 -0500
>>From: Richard Wackerbarth <rkw@Dataplex.NET>
>
>>You are correct that time precision, by itself, will never solve the
>>multi-processor race condition that you describe.
>
>>Rather than use the completion time of the operation, we should be using
>>the starting time. This, coupled with the requirement, in "make" that
>>the result always be "newer", by at least one tick, than each of its
>>inputs will cause the results to be correct.
>
>I would expect that if you're concerned with timestamps generated by
>multi-processing systems, that it might be worth considering using a CPU
>number as the last few bits of the timestamp -- beyond the accuracy of
>anything "real" -- as a tie-breaker.
>
>As I recall, this is the technique IBM used on the s/3x0 "store clock"
>instruction....

Sorry go on Apollo's again, but....

Every object under Domain-OS had a ID which was based on:
	Node-id.timestamp

The node-id was the ID burned into a prom on the motherboard.
the timestamp was derived from a RTC with 4us resolution, and was guaranteed
to be uniq.

You could (almost) do the same using the MAC addresses from an ethernet card, 
tossing the first two bytes. Most likely you don't any collisions from
that omission in you local network.

--WjW
-- 
Internet Access Eindhoven BV.,  voice: +31-40-2 393 393, data: +31-40-2 606 606
P.O. 928, 5600 AX Eindhoven, The Netherlands
Full Internet connectivity for only fl 12.95 a month.
Call now, and login as 'new'.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



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