need to suspend/resume a child thread

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

    need to suspend/resume a child thread

    A child thread has a long-time executions, how to suspend it and resume
    back the orignial place ?
    I know it' nature to use singal, but child thread cannot get signal as
    Python Manual say. And i dnt like to check status variable as the
    long-time executions can not or be dirty to stop to do check.
  • Miki

    #2
    Re: need to suspend/resume a child thread

    Hello,
    A child thread has a long-time executions, how to suspend it and resume
    back the orignial place ?
    I don't think you can do it using Python's thread API.
    You can either use a platform specific API (such as pywin32) or make
    the thread "cooperativ e" and wait on a condition/semaphore in some
    inner loop.
    I know it' nature to use singal, but  child thread cannot get signal as
    Python Manual say.  And i dnt like to  check status variable  as the
    long-time executions can not or be dirty to stop to do check.
    Threads and signals don't play well together. Not recommended.

    HTH,
    --
    Miki <miki.tebeka@gm ail.com>
    If it won't be simple, it simply won't be. [Hire me, source code]


    Comment

    Working...