Solved

Application.Exit - is not killing all the thread.

Posted on 2010-09-09
9
351 Views
Last Modified: 2012-05-10

VS 2005 / VB.Net

Application.Exit - is not killing all the thread which is invoked by Main Application.

How to kill all the threads, when we execute the application.
0
Comment
Question by:chokka
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 3

Expert Comment

by:packratt_jk
ID: 33641909
Either do a Thread.Join(threadobject), or else set the thread's IsBackground property to true (before you start it).
0
 

Author Comment

by:chokka
ID: 33642094
Can i get complete syntax ?
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 33642191
"Application.Exit - is not killing all the thread which is invoked by Main Application."

Can you show us how you are creating the threads?...
0
 

Author Comment

by:chokka
ID: 33642200
Application is calling the Reports
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 33642231
Can you show us how are opening these reports then?...
0
 
LVL 5

Expert Comment

by:vivekpv10
ID: 33643760
try defining the thread you are creating  as a Background worker,
when you define the thread. like this...
thread t = new thread(new threadstart(function));
t.IsBackground = true;
t.Start();
0
 
LVL 1

Expert Comment

by:paultantony
ID: 33643796
Try to close all threads using ExitThread and then use the Application.Exit
0
 
LVL 1

Accepted Solution

by:
paultantony earned 500 total points
ID: 33643806
You may also use System.Environment.Exit or end statement but both are ungraceful way of ending the program. you should close all the threads and forms and end gracefully. you may also try Environment.Exit(0)
0
 

Author Comment

by:chokka
ID: 33760945

 Now i have replaced the code from Application.Exit to Environment.Exit(0)

I have to wait for the results from Testing Team
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now