[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-09-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Committed in r84489 (3.x), r84490 (3.1) and r84491 (2.7). Thank you! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed versions: -Python 2.6 ___ Python tracker

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-02-16 Thread Nikolaus Rath
Nikolaus Rath nikol...@rath.org added the comment: Does this patch still need review? Both Martin and Antoine already commented that the patch is ok, so it'd be great if someone could actually apply it... -- ___ Python tracker rep...@bugs.python.org

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-24 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I think the bug here is really in the application, which makes a system call to fuse and the fuse callback in the same process. This isn't supported, and IMO doesn't need to be. Python makes no promises that it will accept callbacks while

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-22 Thread Nikolaus Rath
Nikolaus Rath nikol...@rath.org added the comment: The patch works fine for me too. Also, I did not discover any other such problems for other syscalls (but I did not systematically try all os.* functions). -- ___ Python tracker

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7736 ___ ___ Python-bugs-list mailing

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Releasing the GIL when calling C library functions (e.g. opendir()) is not a requirement, it's just an optimization for slightly better multi-threading. Also, as shown in the backtrace, PyGILState_Ensure() is called which should only try to

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Nikolaus Rath
Nikolaus Rath nikol...@rath.org added the comment: In this simple example, FUSE does not fork and does not start any threads. Note that PyGILState_Ensure() cannot do anything here. What happens is this: - call_hello.py calls FUSE in a new thread, releasing the GIL. - FUSE mounts the file

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Ah, thanks for the explanation. Yes indeed the patch looks ok for the job. You should just be aware that similar problems may appear with other system calls. I don't think we have ever considered that common C calls such as opendir() could call

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Nikolaus Rath
Nikolaus Rath nikol...@rath.org added the comment: I have used both of them in the past, but in the end I wrote my own bindings (currently only available as part of the http://code.google.com/p/s3ql source code, but I intend to factor it out at some point), since neither fuse.py

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Nikolaus Rath
Nikolaus Rath nikol...@rath.org added the comment: On 01/20/2010 07:19 AM, Antoine Pitrou wrote: Ah, thanks for the explanation. Yes indeed the patch looks ok for the job. You should just be aware that similar problems may appear with other system calls. I don't think we have ever considered

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Well, now that I know what to look for, tracking down more of these problems should be significantly faster and easier. Are you generally going to accept similar patches for other unprotected syscalls? Until now the rule of thumb was to

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Marcin Bachry
Marcin Bachry hegel...@gmail.com added the comment: Still, I'd be extremly grateful if someone could tell me the trick how to create a backtrace in such a deadlock situation Sorry, I should have mentioned that. In order to get backtrace you let the process freeze, attach gdb to it (it will

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-19 Thread Nikolaus Rath
Changes by Nikolaus Rath nikol...@rath.org: -- title: ctypes freezes/deadlocks process - os.listdir hangs since opendir() and closedir() do not release GIL ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7736

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-19 Thread Brian Curtin
Changes by Brian Curtin cur...@acm.org: -- keywords: +needs review nosy: +brian.curtin priority: - normal stage: - patch review versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7736