Background thread in .NET

Posted by Xodarap on Stack Overflow See other posts from Stack Overflow or by Xodarap
Published on 2010-05-21T14:35:58Z Indexed on 2010/05/21 14:50 UTC
Read the original article Hit count: 216

Filed under:
|

When the user saves some data, I want to spin off a background thread to update my indexes and do some other random stuff. Even if there is an error in this indexing the user can't do anything about it, so there is no point in forcing the main thread to wait until the background thread finishes. I'm doing this from a ASP.NET process, so I think I should be able to do this (as the main thread exiting won't kill the process).

When I set a breakpoint in the background thread's method though, the main thread also appears to stop. Is this just an artifact of visual studio's debugger, or is the main thread really not going to return until the background thread stops?

© Stack Overflow or respective owner

Related posts about c#

Related posts about multithreading