468,478 Members | 2,131 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,478 developers. It's quick & easy.

Threading Windows

Using VS 2003, VB.NET, MSDE ...

I am surprised that certain things are creating threads listed in debugging
threading window (with no name or information, just the ID).

For example, the opening an SQL connection creates a thread, that remains
after the connection is closed. Such as the line below.
' test that SQL server is functioning by opening connnection. Note
that this tries repeatedly, so there is a delay before it errors out if it
is unavailable.

CD_Temp.Cnn_For_CSolutionDatabaseSQL.Open()

The name of the thread before and after the .OPEN line above is
"Main_Thread" (as expected), but in the threads window after the .OPEN line
it adds a new thread that says:

ID Name Location Priority

736 <No Name> (blank) Highest

Why is this created? Can I/Should I .abort the thread (I don't see how)?
Should I worry about it? Will garbage collection eventually get rid of it
anyway?

Does .NET create its own threads to do things (such as above) behind the
scenes, or do threads have to be explictly created in code? (obvisouly,
based on this post, I guess the first part or that statement is accurate).

Thanks

Bob


Nov 20 '05 #1
4 736
In article <u6**************@TK2MSFTNGP10.phx.gbl>, Bo****@TouchTalk.net
says...
Why is this created? Can I/Should I .abort the thread (I don't see how)?
Should I worry about it? Will garbage collection eventually get rid of it
anyway?
Why created -- who knows. It's part of the implementation. And no, I
wouldn't worry about it. And no, if it's not your thread you shoulnd't
abort it (in fact, you might not even have permission to abort a thread
that isn't yours).
Does .NET create its own threads to do things (such as above) behind the
scenes, or do threads have to be explictly created in code? (obvisouly,
based on this post, I guess the first part or that statement is accurate).


Yes, .NET creates a thread for the garbage collector and it might create
an additional one for the finalizer queue (not sure on this one though).

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #2
Hi Bob,

Thanks for posting in the community.

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you observe that when you do a
connecting to a SQL server, there will be a new thread created.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I agree with Patrick's answer, I think for performance concern, the .NET
runtime will create such thread to improve the performance and you do not
need to abort them, .NET runtime will manage it.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #3
Hi Bob,

Thanks for posting in the community.

Did my reply answer your question?
I would appreciate if you could provide an update by posting a message in
the Newsgroup thread letting us know whether the information provided in
the response was useful in resolving the issue. If you still have
questions, please reply to the thread to let us know you need further
assistance.
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #4
Yes, the problem is resolved. Thanks for your help.
Bob
"Peter Huang" <v-******@online.microsoft.com> wrote in message
news:uE**************@cpmsftngxa07.phx.gbl...
Hi Bob,

Thanks for posting in the community.

Did my reply answer your question?
I would appreciate if you could provide an update by posting a message in
the Newsgroup thread letting us know whether the information provided in
the response was useful in resolving the issue. If you still have
questions, please reply to the thread to let us know you need further
assistance.
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

22 posts views Thread by Jorge Godoy | last post: by
6 posts views Thread by CK | last post: by
7 posts views Thread by Terry Olsen | last post: by
reply views Thread by Colmeister | last post: by
6 posts views Thread by hzgt9b | last post: by
reply views Thread by kingcrowbar.list | last post: by
7 posts views Thread by Mike P | last post: by
19 posts views Thread by frankiespark | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by kmladenovski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.