about Python/C extensions and thread

K

kanji

Hi

I know this question has been posed quite a number of times - but I
could did not find a suitable answer to my problem. I have created
a C library and its corresponding Python/C extension src file to
generate a python module.

My problem- is when i call the corresponding python functions (ie
which are actually calls of extension src file) in a multi-threaded
ptython program- i see either one of these two situations--
1. One thread runs to completion and the other hangs.
2. both the thread runs to completion.

This happens randomly.

now in each of the C functions of the Python/C extension src file - i
call a thread-safe C library function. This has been verified by a
separate threaded C client.

As per the docs, i have tried using Py_Begin_Allow_Threads /
PY_End_Allow_Threads macros in extension code but it hasn't helped.


Any ideas or pointers will be greatly appreciated.

Little frustated,


kanji

(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top