473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Thread termination

Hi all,

Does any one know how to terminate or kill a thread that is started
with "start_new_thread()" in the middle of its execution?

Any pointers?

Thanks in advance

Teja.

Oct 13 '06 #1
4 1443
Teja schrieb:
Hi all,

Does any one know how to terminate or kill a thread that is started
with "start_new_thread()" in the middle of its execution?

Any pointers?
This has been discussed a bazillion times in this NG. The short answer
is: no.

For the long answer: do some googling :)

Diez
Oct 13 '06 #2
"Teja" <te*********@gmail.com>wrote:
Hi all,

Does any one know how to terminate or kill a thread that is started
with "start_new_thread()" in the middle of its execution?

Any pointers?

Thanks in advance

Teja.
can't be done from outside without co operation of thread in question.
google this newsgroup
- Hendrik

Oct 14 '06 #3
Hendrik van Rooyen <ma**@microcorp.co.zawrote:
can't be done from outside without co operation of thread in question.
google this newsgroup
Hopefully google will discover also the thread where the above statement is
proved to be false ;-)

This might be a useful thing to search for...

ctypes.pythonapi.PyThreadState_SetAsyncExc

--
Nick Craig-Wood <ni**@craig-wood.com-- http://www.craig-wood.com/nick
Oct 14 '06 #4
"Nick Craig-Wood" <ni**@craig-wood.comwrote:

Hendrik van Rooyen <ma**@microcorp.co.zawrote:
can't be done from outside without co operation of thread in question.
google this newsgroup

Hopefully google will discover also the thread where the above statement is
proved to be false ;-)

This might be a useful thing to search for...

ctypes.pythonapi.PyThreadState_SetAsyncExc
Where were you when we needed you some week or two ago?

I *could* argue that using ctypes is cheating.... - But I wont...

- Hendrik

Oct 14 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Jerry Sievers | last post by:
Greetings Pythonists; I have limited experience with threaded apps and plenty with old style forked heavyweight multi-processing apps. Using Python 2.3.3 on a Redhat 7.x machine. Wondering...
2
by: ice88 | last post by:
I would like to execute some code when a thread terminates, in the context of that thread - I guess similar to an ExitThread handler - is it possible in a C# .NET application? I can see a way to...
20
by: Doug Thews | last post by:
I ran into an interesting re-pain delay after calling the Abort() method on a thread, but it only happens the very first time I call it. Every time afterward, there is no delay. I've got a...
10
by: Fernando Rodríguez | last post by:
Hi, Assume I have Main function that looks like this: static void Main(string args) { Action h1 = new Action(0);
7
by: Charles Law | last post by:
My first thought was to call WorkerThread.Suspend but the help cautions against this (for good reason) because the caller has no control over where the thread actually stops, and it might have...
0
by: Sir Spamallot | last post by:
Hi there, Previously when handling the termination of threads I had just called the abort method and caught it in a try catch block in the thread callback. After recently learning that this was...
3
by: Raj Wall | last post by:
Hi, I have an application that uses a number of sub-threads. What is the best way to do some processing in each thread when the main application is shut down? Is the ThreadAbortException...
1
by: Sanjay | last post by:
Hi All Have an app. On start up it creates a thread and goes to sleep. Either on termination or completion of the worker thread, it triggers the main app to start executing. Question Why...
5
by: care02 | last post by:
Hi! I have the following problem: I have written a short Python server that creates an indefinite simulation thread that I want to kill when quitting (Ctrl-C) from Python. Googling around has...
2
by: Mike | last post by:
Hello, Ok I have 2 classes in my project, one is the main form and one is a connection class, at a certain event on my main form a new instance is made of the connection class, and a reference...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.