<br><br><div class="gmail_quote">On Wed, Feb 13, 2013 at 8:08 PM, Matthew Dawson <span dir="ltr"><<a href="mailto:matthew@mjdsystems.ca" target="_blank">matthew@mjdsystems.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">As it has been explained to me, the chances of generating duplicate UUIDs is<br></div></div>
so small as to not exist (even taking into account such things as the Birthday<br>
Paradox).  I don't think worrying about it is worth it.<br></blockquote><div><br>Then maybe I should just remove the check? It'll be a lot simpler.<br><br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

That being said, the increasing number thing is useful too.  Three issues I<br>
quickly forsee:<br>
1) Is this a hot path?  Since only one id can generated at a time, it needs<br>
proper locking.<br></blockquote><div><br>QAtomicInt<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2) It is critically important that you store the integer before the new<br>
resource, since otherwise you may end up with a duplicate in case of system<br>
failures.  And checking for a duplicate's existance brings you back to square<br>
one.<br></blockquote><div><br>I'm not sure what you mean by store the integer.  <br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
3) What happens when the number wraps around (if that is possible)?<br></blockquote><div><br>That's not exactly possible. <br><br clear="all"></div></div><br>-- <br><span style="color:rgb(192,192,192)">Vishesh Handa</span><br>