<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ExitThread() in managed program?</title><link>http://blogs.msdn.com/yunjin/archive/2004/01/30/65386.aspx</link><description>I've seen people calls OS's ExitThread in managed applications via PInvoke to exit a managed thread, like this: [DllImport( "Kernel32.dll")] public static extern void ExitThread(int exitCode); public static void Run () { ... // calling OS's ExitThread</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: ExitThread() in managed program?</title><link>http://blogs.msdn.com/yunjin/archive/2004/01/30/65386.aspx#65667</link><pubDate>Sat, 31 Jan 2004 23:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:65667</guid><dc:creator>Justin Rogers</dc:creator><description>I'd say yes, it is almost always a mistake.  However, there are circumstances where a managed thread becomes unusable or the Abort method doesn't work or takes a long time to actually clean up the thread.  I know there are certain types of stack overflow conditions under V1 and V1.1 that caused this situation to occur and you have to use a PInvoke to kill the thread.  Unfortunately managed threads aren't nearly as robust as native threads.</description></item><item><title>re: ExitThread() in managed program?</title><link>http://blogs.msdn.com/yunjin/archive/2004/01/30/65386.aspx#69136</link><pubDate>Sat, 07 Feb 2004 06:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:69136</guid><dc:creator>Yun Jin</dc:creator><description>Very interesting point. Indeed V1 and V1.1 ARE not reliable in face of OutOfMemoryException and StackOverflowException. I could imagine that you might have trouble to unwind a thread appropriately under such conditions. Improving robustness is an important goal for Whidbey. In Whidbey, big efforts are invested to handle OutOfMemoryException and StackOverflowException in every corner of CLR. Chris Brumme has several great posts about this topic in his blog. &lt;br&gt;When Whidbey is shipped, it's supposed to be reliable enough to run in SQL server. So I hope your problem would be solved then. :)</description></item><item><title>ExitThread() in managed program?</title><link>http://blogs.msdn.com/yunjin/archive/2004/01/30/65386.aspx#6524854</link><pubDate>Mon, 26 Nov 2007 05:56:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6524854</guid><dc:creator>ExitThread() in managed program?</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://feeds.maxblog.eu/item_1082414.html"&gt;http://feeds.maxblog.eu/item_1082414.html&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>