Hi,
how does one end a thread when it is done eg i have a program the when u press a button it starts a thread, this thread performs a set of instructions and then when it is done it it finished how do you end a thread then when the code is done, thus allowing the user to perform mulitple queries?
Thanks
You should check out the. Net 4 Framework an the addition of Task. They did a really nice job with cancelling a threat orderly without the need for Abort.
The reason I say this is for long running queries, you have to wait until they finish before thread cleanup really happens. CancellationTokenResource, you have complete control to stop gracefully without raising an exception.