views:

83

answers:

1

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?

+2  A: 

When you debug in VS the other threads will also stop, although not always in the same spot.

Francisco Noriega
And this is by design--you don't want one thread going off and potentially changing the state of the application you're trying to debug. Also note that you can manually freeze/unfreeze the threads that you're interested in.
JSBangs