[Mono-dev] [PATCH] TcpChannel hang on Windows.

Kornél Pál kornelpal at gmail.com
Fri Dec 19 06:38:31 EST 2008


Hi,

I've modified the test case to call QueueUserAPC.
And both MS.NET and Mono (without your patch) seems to process the APC.

This still makes me think that the difference is in killing threads 
rather than in Socket implementation.

When I uncommented thread.Abort(), both runtimes terminated the thread, 
but MS.NET prints "New thread state: Stopped" while Mono prints "New 
thread state: Stopped, AbortRequested" that may be the source of bugs.

Kornél

Bill Holmes wrote:
> Kornél,
> 
> I tested your case and it appears to work fine with my changes.  I
> believe that this is because I check for the ThreadState_StopRequested
> state.  I do not check for ThreadState_AbortRequested.  That is
> intentional because that is the behavior I observed with MS .net.
> Also if I understand it correctly mono_thread_manage wait on all non
> background threads to complete before it sets the
> ThreadState_StopRequested on the background threads only and waits for
> those.
> 
> I also toggled the background flag in you example to ensure the two
> runtimes behave the same.
> 
> Thanks so much for your review!
> -bill
> 
> For those interested this is the case I am attempting to fix...
> 
> static void Main (string[] args)
> {
> 	TcpChannel tc = new TcpChannel (0);
> }
> 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: BlockingAccept.cs
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20081219/32330aed/attachment.pl 


More information about the Mono-devel-list mailing list