开发者

C# process lingers after all threads have terminated

I have a multithreaded C# "console" application with lots of threads trhat finishes up. All my threads exit. 90% of the time the application gra开发者_JS百科cefully exits. But 10% of the time a copy of my application lingers: console still open.

I attach to this via Visual Studio 2010 and use break to interrupt it, and am shown two "empty" stack frames: one for Main and one for one of my application-created threads. Neither has anything on the stack. Visual Studio says that "source code is not available for the thread" if I click on either of these threads, and it offers a "dissambled code view" link. I click on that and it says "disassembled code is not available for this thread".

Any ideas what I might be doing wrong?


Does you code shut down after some extra minutes. It could be that some .net helper thead or garbage collection thread is still running. That might take some extra time.

Are you running a debug build or a release build and are you sure the process is not one of those visual studio hosted processes that keeps running for design purposes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜