about Python/C extensions and thread

Discussion in 'Python' started by kanji, Sep 17, 2004.

  1. kanji

    kanji Guest

    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

    kanji, Sep 17, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike C. Fletcher
    Replies:
    3
    Views:
    968
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Oct 12, 2003
  2. John Ky
    Replies:
    1
    Views:
    343
    Daniel Dittmar
    Nov 24, 2003
  3. Tim Fuehner
    Replies:
    0
    Views:
    391
    Tim Fuehner
    Dec 8, 2003
  4. tristan625
    Replies:
    0
    Views:
    268
    tristan625
    May 31, 2009
  5. Replies:
    4
    Views:
    96
    Robert Klemme
    Jan 23, 2006
Loading...

Share This Page