Skip site navigation (1)Skip section navigation (2)
Date:       Thu, 24 Aug 2000 08:49:28 +1000
From:      Peter Jeremy <peter.jeremy@alcatel.com.au>
To:        Josef Karthauser <joe@pavilion.net>
Cc:        Nate Williams <nate@yogotech.com>, Warner Losh <imp@village.org>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/games/fortune/datfiles fortunes
Message-ID:  <00Aug24.084930est.115202@border.alcanet.com.au>
In-Reply-To: <20000823184240.B13773@pavilion.net>; from joe@pavilion.net on Wed, Aug 23, 2000 at 06:42:40PM %2B0100
References:  <200008231604.KAA11402@nomad.yogotech.com> <20000814003636.A74639@pavilion.net> <200008140753.AAA08038@netplex.com.au> <20000819124824.E88550@lucifer.bart.nl> <20000822161835.B807@dragon.nuxi.com> <20000823091714.D650@pavilion.net> <200008231648.KAA02382@billy-club.village.org> <200008231704.LAA02617@billy-club.village.org> <200008231707.LAA12343@nomad.yogotech.com> <20000823184240.B13773@pavilion.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2000-Aug-23 18:42:40 +0100, Josef Karthauser <joe@pavilion.net> wrote:
>If we had an incrementing number we need locking and a counter file.

Which isn't that difficult.  Perl provides access to flock() and
fcntl() so there would be nothing preventing the commit script from

	open(SERIAL, '+>/path/to/serial/number');
	flock(SERIAL, 2);
	$serial = 0 + <SERIAL>;
	print SERIAL $serial + 1, "\n";
	close(SERIAL);

(with approprate error checking added).  I agree that this would add
a serialisation operation to the commit process, but the lock should
only be held for a fraction of a second and so shouldn't noticably
slow down commits.

Peter


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00Aug24.084930est.115202>