Message70561
| Author |
loewis |
| Recipients |
amaury.forgeotdarc, benjamin.peterson, loewis, pitrou |
| Date |
2008年08月01日.15:45:38 |
| SpamBayes Score |
0.009899292 |
| Marked as misclassified |
No |
| Message-id |
<1217605539.5.0.942982690815.issue3476@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I don't think the proposed patch (file11012) makes it thread-safe, and I
believe you cannot get it thread-safe without using thread synchronization.
For example, if two threads simultaneously determine that there is still
space left (len(b) <= free), they might both write to self._write_buf
and self._write_end, and the last writer would win. (In case it isn't
clear how this might happen: thread 1 exhausts its Py_Ticker just after
checking the size, then thread 2 runs a full .write(), then thread 1
continues filling the buffer) |
|