473,395 Members | 1,738 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,395 software developers and data experts.

Kill thread

Hi all,

Can any on help me out in killing a thread (i.e deleteing the reources
like, stack ,memory etc) which is started with
win32process.beginthreadex()???

Rite now, I am suspending the thread. But any pointers as to how to
delete the thread permanently?

Its pretty urgent... Please...
Teja.P

Apr 9 '07 #1
5 2668
Hi!

If you have the PID of the process (example: 1234), use this
command-line :
TASKKILL /F /PID 1234



--
@-salutations

Michel Claveau
Apr 9 '07 #2
On Apr 9, 3:01 pm, Michel Claveau
<mcPas.De.S...@mclaveauPas.De.Spam.comwrote:
Hi!

If you have the PID of the process (example: 1234), use this
command-line :
TASKKILL/F /PID 1234

--
@-salutations

Michel Claveau
Hi Michel,

Thnks for the reply....But TASKKILL kills the process entirely..Not
the thread.

I want only the thread to be killed.
Actually I am starting the thread in main thread. I jus want to kill
the child thread and
keep the main thread running.

With TASKKILL, the main thread is also exited...I dont want it to
happen..

Wht do i do??

Awaiting for a reply

Teja.P

Apr 9 '07 #3
On Apr 9, 5:14 am, "Teja" <tejovath...@gmail.comwrote:
Hi all,

Can any on help me out in killing a thread (i.e deleteing the reources
like, stack ,memory etc) which is started with
win32process.beginthreadex()???

Rite now, I am suspending the thread. But any pointers as to how to
delete the thread permanently?

Its pretty urgent... Please...

Teja.P
Well, the answer with Python threads is that you don't kill them - you
ask them to go away. But since you are using something in the pywin32
package, that rule might not apply. Perhaps you would have better
luck asking on the python-win32 list:
http://mail.python.org/mailman/listinfo/python-win32

Christian
http://www.dowski.com

Apr 9 '07 #4
On Apr 9, 6:18 pm, "Christian" <christ...@dowski.comwrote:
On Apr 9, 5:14 am, "Teja" <tejovath...@gmail.comwrote:
Hi all,
Can any on help me out in killing a thread (i.e deleteing the reources
like, stack ,memory etc) which is started with
win32process.beginthreadex()???
Rite now, I am suspending the thread. But any pointers as to how to
delete the thread permanently?
Its pretty urgent... Please...
Teja.P

Well, the answer with Python threads is that you don't kill them - you
ask them to go away. But since you are using something in the pywin32
package, that rule might not apply. Perhaps you would have better
luck asking on the python-win32 list:http://mail.python.org/mailman/listinfo/python-win32

Christianhttp://www.dowski.com
Can TASKKILL kill threads? For the TASKKILL command

TASKKILL /F /PID 1234 , I gave thread id instead of PID....

It didnt throw any error. Does that mean that thread is really killed,
releasing all its resources>

How can I ensure that the thread is killed?


Apr 9 '07 #5
En Mon, 09 Apr 2007 06:14:26 -0300, Teja <te*********@gmail.comescribió:
Can any on help me out in killing a thread (i.e deleteing the reources
like, stack ,memory etc) which is started with
win32process.beginthreadex()???
As you can read on:
http://msdn2.microsoft.com/en-us/lib...cb(VS.80).aspx
if you use this C runtime function, you should call _endthreadex() (from
the same thread you want to end!)

I wonder, why don't you use the thread support already present in Python?

--
Gabriel Genellina

Apr 9 '07 #6

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...
5
by: Blatwurst | last post by:
I'm trying to implement a simple server in C#. I want to do the classic thing of spinning off a thread that just blocks in a Socket.Accept() call until a request comes in. At that point, the...
6
by: RickDee | last post by:
Understand that when I start a thread, a number will be generated and is able to get from GetHashCode method. But I would like to use this number when I want to kill certain thread, anybody know...
3
by: Stewart | last post by:
Hey Group, Hoping someone can help me out. I have some code which starts up some asynchronous code using a delegate. The code is below. Basically my main code (not shown) calls...
9
by: Brett | last post by:
I'm trying to kill a thread spawned this way: Form1 spawns Class1 via Thread.start() Here's my code to kill the thread: If (t.ThreadState.ToString = "SuspendedRequested, WaitSleepJoin") Or...
2
by: Christopher Carnahan | last post by:
I need to figure out how to terminate a thread while it is blocked trying to create a COM object via interop. In a worker thread, I do something like this: Type t = null; Object...
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...
18
by: =?Utf-8?B?VGhlU2lsdmVySGFtbWVy?= | last post by:
Because C# has no native SSH class, I am using SharpSSH. Sometimes, for reasons I do not know, a Connect call will totally lock up the thread and never return. I am sure it has something to do...
20
by: =?ISO-8859-1?Q?Gerhard_H=E4ring?= | last post by:
John Dohn wrote: When I do this, I put a special value in the queue (like None) and in the worker thread, check for the special value and exit if found. Threads can also be marked as "daemon...
1
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi misters, Is it possible "kill" the thread of Backgroundworker ? In my Dowork event, I have NOT While for do e.Cancel = true, only have a call to external COM. If I want cancel, calling...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.