[issue8865] select.poll is not thread safe

2012-12-04 Thread Christian Schubert
Christian Schubert added the comment: What's a proper test for this? Testing, that the (now expected) exception occurs when invoking poll concurrently? Or rather, that the race condition does not occur? Last time I checked, pypy handled the concurrent poll invocation well, so it would fail

[issue8865] select.poll is not thread safe

2012-11-13 Thread Christian Schubert
Christian Schubert added the comment: Would you please submit a PSF contributor agreement form? FYI: did that yesterday 9:43 UTC, no reaction (yet) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8865

[issue8865] select.poll is not thread safe

2012-11-12 Thread Christian Schubert
Christian Schubert added the comment: new proposed fix: forbid concurrent poll() invocation -- Added file: http://bugs.python.org/file27967/issue8865_v2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8865

[issue8865] select.poll is not thread safe

2012-11-12 Thread Christian Schubert
Christian Schubert added the comment: I doubt about the exception type. May be RuntimeError is more appropriate? mea culpa, just copypasted without actually looking; fixed in v3 -- Added file: http://bugs.python.org/file27968/issue8865_v3.diff

[issue8865] select.poll is not thread safe

2012-11-11 Thread Christian Schubert
Christian Schubert added the comment: How about raising an error on concurrent modification, instead of trying to make it thread-safe? That's totally fine with me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8865

[issue8865] select.poll is not thread safe

2010-06-15 Thread Christian Schubert
Christian Schubert b...@apexo.de added the comment: added a patch which fixes both issues before releasing the GIL we take a copy of the ufds pointer and its len, erasing the ufds pointer in the poll object (to make sure nobody else fiddles with it); when we're done we either but it back

[issue8865] select.poll is not thread safe

2010-06-01 Thread Christian Schubert
Christian Schubert b...@apexo.de added the comment: okay, I've managed to put together a script that fairly consistently reproduces the problem on my (core2 duo 2,something GHz) machine some parameters (sleep times) are randomized in each iteration, the script runs for 30 iterations, each

[issue8865] select.poll is not thread safe

2010-06-01 Thread Christian Schubert
Christian Schubert b...@apexo.de added the comment: the other issue (poll_register freeing data structures that poll_poll currently uses) can be reproduced by the attached script (at least I can) depending on the parameters/circumstances it either segfaults or prints garbage results from poll

[issue8865] select.poll is not thread safe

2010-05-31 Thread Christian Schubert
New submission from Christian Schubert b...@apexo.de: invoking select.poll.poll() concurrently from multiple threads frequently yields garbage in one thread: while poll_poll in thread 1 is parsing its result, another thread 2 calling poll may overwrite revents; assuming poll_result was 1