Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

Why does the thread die with no exception thrown and the process continues?

$
0
0

I have a multi-threaded application: very intense operations.

So intense that I call it a foreach loop that talks to the database.

That is how complex this.

Now, I have set the code to write out any exception thrown in the Console, but more than that, I have the monitor built into visual studio telling me about events in the IDE running the code which lists all exceptions as events.

So, I see in the debugger the foreach loop load items (general pocos) into a list of that type.

At this point, the amount of memory consumption is 200mb+. The CPU usage yoyos between 50% and 100%.

I have a i7 core processor with 4 physical cores. I am deploying 9 threads, the same thing happens with 2 threads.

So the foreach loop never signals that it dies, however, eventually the code right bellow the foreach is never reached because if it had been it would have shown me in the debugger and it would have returned to the previous method that called it. 

It is in a try and catch: Catch Exception. The exception never occurs in the event viewer with Visual Studio and it is not written out to the console. In fact the break point at the Console.WriteLine is never hit.

Checking around all logs, no exception is thrown, there no evidence why it died and never exited the for loop. In fact it doesn't say Thread Aborted or Exited. Just nothing, it just dies and keeps going. If I remove the try and catch it does the same thing.

Why is there no error or output of any kind to signal that it died?


Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>