about Python/C extensions and thread

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kanji

    #1

    about Python/C extensions and thread

    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_Th reads macros in extension code but it hasn't helped.


    Any ideas or pointers will be greatly appreciated.

    Little frustated,


    kanji

    kanji_rama@goog le.com
Working...