➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 christian.heimes
收信人 christian.heimes, hynek, tarek, vstinner
日期 2013-08-16.15:21:37
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1376666498.06.0.618743202178.issue18756@psf.upfronthosting.co.za>
In-reply-to
内容
I have seen complains from e.g. Tarek that os.urandom() fails under high load: https://twitter.com/tarek_ziade/status/362281268215418880

The problem is caused by file descriptor limits. os.urandom() opens /dev/urandom for every call. How about os.urandom() uses a persistent file descriptor? That should eliminate the error. It may alsos speed up os.urandom() because a persistent FD gets rid of open() and close() syscalls.

* open /dev/urandom on first call of os.urandom() and store the fd in a static var
* invalidate, close fd on read() -> EINVAL; open /dev/urandom again
* close fd when interpreter shuts down
历史
日期 用户 动作 参数
2013-08-16 15:21:38christian.heimes修改recipients: + christian.heimes, vstinner, tarek, hynek
2013-08-16 15:21:38christian.heimes修改messageid: <1376666498.06.0.618743202178.issue18756@psf.upfronthosting.co.za>
2013-08-16 15:21:38christian.heimes链接issue18756 messages
2013-08-16 15:21:37christian.heimes创建