[IronPython] Problem with random module in IPY 1.1.1

Ronnie Maor ronnie.maor at gmail.com
Mon Oct 13 22:57:13 CEST 2008


problem was caused by calling random from several threads without locking.
it reproduces more easily in IPy than in CPython because of the GIL, but
it's documented as not thread safe for CPython too.

On Sun, Oct 12, 2008 at 11:27 AM, Asaf Kleinbort <asaf at itstructures.com>wrote:

>  Hi,
>
> We have encountered two strange errors in the 'random' module:
>
> 1.       At some point the random method 'getrandbits(63)' started (and
> kept) returning 0 – until we restarted the application.
>
> 2.       The random method 'shuffle' when applied on a list kept returning
> the same ordered list. Again – restarting the application solved the problem
>
> An interesting remark is that issue #1 happened to us today in two
> different applications, around the same time.
>
> Any ideas?
>
> Thanks,
>
> Asaf
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20081013/dd58d83e/attachment.html>


More information about the Ironpython-users mailing list