<div dir="ltr">problem was caused by calling random from several threads without locking.<br>it reproduces more easily in IPy than in CPython because of the GIL, but it&#39;s documented as not thread safe for CPython too.<br>
<br><div class="gmail_quote">On Sun, Oct 12, 2008 at 11:27 AM, Asaf Kleinbort <span dir="ltr">&lt;<a href="mailto:asaf@itstructures.com">asaf@itstructures.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">









<div link="blue" vlink="purple" lang="EN-US">

<div>

<p>Hi,</p>

<p>We have encountered two strange errors in the 'random'
module:</p>

<p style="text-indent: -0.25in;"><span>1.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span dir="ltr"></span>At some point the random method '<span style="font-size: 10pt;">getrandbits(63)' </span>started
(and kept) returning 0 – until we restarted the application.</p>

<p style="text-indent: -0.25in;"><span>2.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><span dir="ltr"></span>The random method 'shuffle'
when applied on a list kept returning the same ordered list. Again –
restarting the application solved the problem</p>

<p>An interesting remark is that issue #1 happened to us today
in two different applications, around the same time.</p>

<p>Any ideas?</p>

<p>Thanks,</p>

<p>Asaf </p>

</div>

</div>


<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br></div>