Re: unique IDs for connections to ipsvd programs

Alex Efros <[email protected]>
Newsgroups gmane.comp.misc.pape.general
Organization asdfGroup Inc., http://powerman.asdfGroup.com/
Message-ID <[email protected]>
Hi!

On Wed, Nov 14, 2007 at 03:39:52PM +0100, Lasse Kliemann wrote:
> > What do you see if you do:
> >
> > tcpsvd 0 2000 sh -c 'echo "$$:" $(uuidgen) >&2'
> 
> I could not reproduce the above problem with this construct. First of all, 
> thanks for the advice!
> 
> What magnitude is the probability of that I will still get interleaved logs 
> with this solution? Is it like the same order of magnitude as the probability 
> that, say, uuidgen will generate the same ID twice? Then it would not matter.

This isn't something about probability. In example above OS doing _single_
write to file, which is atomic operation, so probability is equal to zero.
Only if size of record to write will be larger than minimum block size
(different in different OS, but no less than 512 bytes AFAIK) then you may
got this issue again... but size of '"$$:" $(uuidgen)' result string is
always less than 512 bytes, so it will work reliable.

-- 
			WBR, Alex.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.