Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #73773 > unrolled thread

thread.interrupt_main() behaviour

Started byPiyush Verma <114piyush@gmail.com>
First post2014-07-01 14:28 +0530
Last post2014-07-01 14:28 +0530
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  thread.interrupt_main() behaviour Piyush Verma <114piyush@gmail.com> - 2014-07-01 14:28 +0530

#73773 — thread.interrupt_main() behaviour

FromPiyush Verma <114piyush@gmail.com>
Date2014-07-01 14:28 +0530
Subjectthread.interrupt_main() behaviour
Message-ID<mailman.11357.1404207056.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

Hi,

What is the behavior when we call thread.interrupt_main() method.

Using this method I have implemented a new method for checking timeout.

359    def TimeoutFunc(self):360       '''Function invoked by timer
thread in case of timeout '''361       self.log.debug("Timeout thread
invoked now for test %s" % self.name)362       self.isTimeout =
True363       #Interrupt test process364       thread.interrupt_main()

Above method is invoked correctly, but I am not able to understand the
behaviour. Please have a look into below diagram to explain which I am
using.

[image: Inline image 1]


Since two threads are running same method, I wanted to know which main
thread will be interrupted in both case.

Regards,
~Piyush
Facebook <https://www.facebook.com/piyushkv1> Twitter
<https://twitter.com/SocializePiyush>

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web