[issue3027] if extended c module is calling Windows API waitForSingleObject, it will block other thread.

2008-06-02 Thread patrick

New submission from patrick <[EMAIL PROTECTED]>:

The c extend module is as the attached file "WindowsFuncs.cpp", it 
wraps some Windows event APIs

The python script is as the attached file "test.py", run that script, 
we could find in the new thread, the calling to Windows API 
waitForSingleObject will block the main thread printing, that's really 
strange. 

The output of running is as the attached file "test.output".

--
components: Interpreter Core
files: attach.zip
messages: 67633
nosy: patrick
severity: normal
status: open
title: if extended c module is calling Windows API waitForSingleObject, it will 
block other thread.
versions: Python 2.5
Added file: http://bugs.python.org/file10502/attach.zip

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3027] if extended c module is calling Windows API waitForSingleObject, it will block other thread.

2008-06-02 Thread Thomas Herve

Thomas Herve <[EMAIL PROTECTED]> added the comment:

You have to release the GIL. See http://docs.python.org/api/threads.html
for some information.

--
nosy: +therve

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3027] if extended c module is calling Windows API waitForSingleObject, it will block other thread.

2008-06-02 Thread patrick

patrick <[EMAIL PROTECTED]> added the comment:

Yes, after wrapping the calling to block operation with marco 
Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS, that issue is gone. 
Thank you.

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3027] if extended c module is calling Windows API waitForSingleObject, it will block other thread.

2008-06-03 Thread Georg Brandl

Changes by Georg Brandl <[EMAIL PROTECTED]>:


--
resolution:  -> works for me
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com