threading module, call thread.interrupt_main()

  • Thread starter §ä´M¦Û¤vªº¤@¤ù¤Ñ
  • Start date
§

§ä´M¦Û¤vªº¤@¤ù¤Ñ

Sorry to ask, but i don't know how to solve it.

I try to call thread.interrupt_main() function in my child thread's run method
which is inherit threading.Thread class.

But it didn't work, does anyone know why?

Thanks a lot!!
 
S

Simon Forman

2009/10/7 §ä´M¦Û¤vªº¤@¤ù¤Ñ said:
Sorry to ask, but i don't know how to solve it.

I try to call thread.interrupt_main() function in my child thread's run method
which is inherit threading.Thread class.

But it didn't work, does anyone know why?

Thanks a lot!!

"it didn't work" is not enough information.

What is your code (smallest version that shows the problem)?

And what is the traceback?
 
G

Gabriel Genellina

En Thu, 08 Oct 2009 00:33:04 -0300, §ä´M¦Û¤vªº¤@¤ù¤Ñ
Sorry to ask, but i don't know how to solve it.

No need to apologize!
I try to call thread.interrupt_main() function in my child thread's run
method
which is inherit threading.Thread class.

But it didn't work, does anyone know why?

Are you join()ing your child thread? In this case the main thread won't
acknowledge the exception until the join() call returns -- probably too
late. A sleep() call isn't interruptible either.

I think it's already reported at http://bugs.python.org but I can't locate
the issue right now.
 
G

Gabriel Genellina

En Thu, 08 Oct 2009 00:33:04 -0300, §ä´M¦Û¤vªº¤@¤ù¤Ñ
Sorry to ask, but i don't know how to solve it.

No need to apologize!
I try to call thread.interrupt_main() function in my child thread's run
method
which is inherit threading.Thread class.

But it didn't work, does anyone know why?

Are you join()ing your child thread? In this case the main thread won't
acknowledge the exception until the join() call returns -- probably too
late. A sleep() call isn't interruptible either.

I think it's already reported at http://bugs.python.org but I can't locate
the issue right now.
 
G

Gabriel Genellina

En Thu, 08 Oct 2009 14:18:48 -0300, Gabriel Genellina
En Thu, 08 Oct 2009 00:33:04 -0300, §ä´M¦Û¤vªº¤@¤ù¤Ñ


Are you join()ing your child thread? In this case the main thread won't
acknowledge the exception until the join() call returns -- probably too
late. A sleep() call isn't interruptible either.

Could you confirm if this was actually your problem? Or something
different?
 

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,023
Latest member
websitedesig25

Latest Threads

Top