Threading

  • Thread starter Gheorghe Postelnicu
  • Start date
G

Gheorghe Postelnicu

Hi,

I have a very simple Python script that performs some batch processing
as follows: a list of system commands is set up in an automated way
and then each of the processes is launched separately using threads -
a basic producer-consumer thing.

I found a recipe on ASPN on how to intercept keyboard interrupts and
that is useful if I need to brutally kill the launching process.

However, my question regards killing the actual children threads -
they are spending lots of time in system calls, so I cannot insert
some while loop in a derived Thread class.

Any suggestions would be apreciated.

Thanks,
 
F

fumanchu

Gheorghe said:
I found a recipe on ASPN on how to intercept keyboard interrupts and
that is useful if I need to brutally kill the launching process.

However, my question regards killing the actual children threads -
they are spending lots of time in system calls, so I cannot insert
some while loop in a derived Thread class.

kill -9?


Bob
 
U

utabintarbo

Gheorghe said:
...
However, my question regards killing the actual children threads -
they are spending lots of time in system calls, so I cannot insert
some while loop in a derived Thread class.

Any suggestions would be apreciated.
Have the threads look for a semaphore file. If it exists, they delete
it and die.

Just an idea....HTH
 

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

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top