Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > threading module, call thread.interrupt_main()

Reply
Thread Tools

threading module, call thread.interrupt_main()

 
 
找尋自己的一片天
Guest
Posts: n/a
 
      10-08-2009
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!!

--
※Post by command from 59-124-255-226.HINET-IP.
老鼠的**豪饕T洞˙電子佈告欄系統˙alexbbs.twbbs.org˙140.113.166.7
 
Reply With Quote
 
 
 
 
Simon Forman
Guest
Posts: n/a
 
      10-08-2009
2009/10/7 找尋自己的一片天 <(E-Mail Removed)>:
> 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?
 
Reply With Quote
 
 
 
 
Gabriel Genellina
Guest
Posts: n/a
 
      10-08-2009
En Thu, 08 Oct 2009 00:33:04 -0300, 找尋自己的一片天
<(E-Mail Removed)> escribi:

> 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.

--
Gabriel Genellina

 
Reply With Quote
 
Gabriel Genellina
Guest
Posts: n/a
 
      10-08-2009
En Thu, 08 Oct 2009 00:33:04 -0300, 找尋自己的一片天
<(E-Mail Removed)> escribi:

> 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.

--
Gabriel Genellina

 
Reply With Quote
 
Gabriel Genellina
Guest
Posts: n/a
 
      10-14-2009
En Thu, 08 Oct 2009 14:18:48 -0300, Gabriel Genellina
<(E-Mail Removed)> escribi:
> En Thu, 08 Oct 2009 00:33:04 -0300, 找尋自己的一片天
> <(E-Mail Removed)> escribi:
>
>> 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.


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

--
Gabriel Genellina

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: threading in PyQt vs threading in standard library Steven Woody Python 0 01-09-2009 07:48 AM
threading in PyQt vs threading in standard library Steven Woody Python 0 01-09-2009 07:15 AM
Cooperative threading preemptive threading - a bit confused failure_to@yahoo.co.uk Java 9 12-29-2007 01:10 AM
Synclock in IIS Hosted Remoting - Single Threading Function Call? Spam Catcher ASP .Net 2 03-07-2007 04:05 AM
Call Manager limit call duration nazgulero Cisco 0 10-25-2005 06:58 AM



Advertisments