control-c and threads

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

    control-c and threads

    Hi!

    When a signal handler is registered in the main thread and
    "control-c" is entered, the child thread is getting the
    KeyboardInterru pt exception(The documentation says the main thread
    MUST receive the signal handler function call if handler is
    registered).

    In python 2.2.1 the main thread was always called with
    the sigint signal handler which was registered. In my case the
    child thread is waiting on stdin using "raw_input" function. This
    seems to be causing all sorts of strange behavior in the program
    once the child thread gets the keyboardinterru pt exception and
    eventually leading to seg fault on a sys exit .

    Any idea why this is happening in 2.3.1? This scenario worked in
    2.2.1. Is this fixed in 2.3.2?.


    Thanks
    Srikanth

  • Lee Harr

    #2
    Re: control-c and threads

    On 2003-12-19, Srikanth Mandava <Srikanth.Manda va@cosinecom.co m> wrote:[color=blue]
    > When a signal handler is registered in the main thread and
    > "control-c" is entered, the child thread is getting the
    > KeyboardInterru pt exception(The documentation says the main thread
    > MUST receive the signal handler function call if handler is
    > registered).
    >
    > In python 2.2.1 the main thread was always called with
    > the sigint signal handler which was registered. In my case the
    > child thread is waiting on stdin using "raw_input" function. This
    > seems to be causing all sorts of strange behavior in the program
    > once the child thread gets the keyboardinterru pt exception and
    > eventually leading to seg fault on a sys exit .
    >
    > Any idea why this is happening in 2.3.1? This scenario worked in
    > 2.2.1. Is this fixed in 2.3.2?.
    >
    >[/color]


    Do you have a minimal example that shows this behavior? I'd be happy
    to run it with 2.3.2 and test it out...


    PS> please post only plain text to the list.

    Comment

    Working...