473,554 Members | 5,365 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Easy Thread Question

I dont know much about threads, so please be easy on explaining me this one.

How do I stop a thread completelly (kill it)?

What happens with a thread that has been started but not killed?

The reason I am asking this is that one of my applications does not removed
from the Task Manager even though I close all my forms and call explicitly
Applicaton.exit at the end. I was thingking the thread inside it might be
the reason. If not, what else could be the reason it just stays hanging in
the Task Manager?

Thank you,

--
Dino Buljubasic
Software Developer
http://rivusglobal.com
Nov 20 '05 #1
4 2979
hi, i used to have this kinda problem but after i use

(assumming you are writing windows form application)
Private Sub form1_Closed(By Val sender As Object, ByVal e
As System.EventArg s) Handles MyBase.Closed
End
End Sub

everything terminate properly....
-----Original Message-----
I dont know much about threads, so please be easy on explaining me this one.
How do I stop a thread completelly (kill it)?

What happens with a thread that has been started but not killed?
The reason I am asking this is that one of my applications does not removedfrom the Task Manager even though I close all my forms and call explicitlyApplicaton.exi t at the end. I was thingking the thread inside it might bethe reason. If not, what else could be the reason it just stays hanging inthe Task Manager?

Thank you,

--
Dino Buljubasic
Software Developer
http://rivusglobal.com
.

Nov 20 '05 #2
Cor
Dino,
I thought that threads are not killed directly is by design (if it is not a
real crazy thing), the framework kills it after a while.
The "thread".ab ort exist. But that does not remove it direct from memory.
Why the program not is clossing, is for me impossible to see from here.
Cor
Nov 20 '05 #3
That is what I thought too but it is the only possible problem I can see.

It is closing, all my forms get closed, but the blue square in IDE tool menu
is still shown and the application is still in Task Manager.

Thanks for your help

--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"Cor" <no*@non.com> wrote in message
news:3f******** *************** @reader21.wxs.n l...
Dino,
I thought that threads are not killed directly is by design (if it is not a real crazy thing), the framework kills it after a while.
The "thread".ab ort exist. But that does not remove it direct from memory.
Why the program not is clossing, is for me impossible to see from here.
Cor

Nov 20 '05 #4
Hello,

"Dino M. Buljubasic" <di************ *@rivusglobal.c om> schrieb:
How do I stop a thread completelly (kill it)?

What happens with a thread that has been started but not
killed?

[...]

You may want to set a boolean flag that is checked by the tread before
exitting. This flag will tell the thread to exit. 'Thread.Abort' usually
should not be used, the thread should kill itself.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #5

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

Similar topics

5
1549
by: Harold Howe | last post by:
Howdy, 1- Are property reads in effect volatile? Or is the compiler allowed to optimize property reads away? ie class foo { public int bar { get { return m_bar;}
36
6522
by: No Spam | last post by:
Dear fellow Access 2003 Users, Is there a way to trim all of the fields in a table in one swoop using VBA (preferred) or a query? Right now, I am using an update query and updating EACH field to it's trimmed counterpart. Any ideas? Thanks! Kevin
2
1211
by: Bonj | last post by:
I have got the starting bits of a game that I am trying to write. I did start to write it in VC++6, but found the basic windows GDI to be of general poor performance for animation. So I decided to switch to GDI+, and as far as I've found on my operating system (WinXP, VS6 and VS.NET 2002) C# is the only language that seems to be capable of...
5
2592
by: Bill Davidson | last post by:
Hello All: I've got a question about synchronization requiremements in a C# worker thread procedure that, among other things, sinks events from outside sources. I realize the worker thread will be interrupted to handle an incoming event (and the flow of execution subsequently diverted to the respective event handler). My question is at...
5
2264
by: AC | last post by:
Any reason i'm having trouble with: DataGrid1.Columns(7).ItemStyle.HorizontalAlign = HorizontalAlign.Right I'm trying to directly set the column alignment of a datagrid created at runtime.. AC
6
1121
by: Matt Long | last post by:
I was wondering if any one could help me out with a threading question. Im developing an app which starts a thread, which in turn starts 4 of its own threads. If I call 'sleep' on the initial thread, will this cause all of its children to sleep also? Thanks in advance.
1
1475
by: melanieab | last post by:
Hi, If there's a textbox and the text entered is longer than what's visible (the textbox length), how do you make it so that the beginning chunk of text is visible (instead of the last part of it)? Thanks again!!! Mel
14
2448
by: google | last post by:
I am creating a new database for use within our company, that I'd like to make reasonably secure (short of a true server based solution). The back-end of a non-server based database seems to be the biggest security hole, due to the ease of opening, linking, and/or importing raw data directly from the back-end database. I've read information...
22
4068
by: Morpheus | last post by:
Hi, I have been coding in Windows for many years so have a mindset to it, so forgive any stupid questions. Is it possible to create a multithread application in C++ that is portable (OS/compiler)? In my Windows applications, I use synchronization objects like, mutex, semaphores etc. Is there anything similar in the Standard ANSI C++ or...
0
7506
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7541
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7872
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6123
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5423
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5142
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3533
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2006
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1114
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.