John,

 

I really do not know if I have or not a treading issue. These things can easily get out of whack.

 

Thanks for the tip. I found it funny that if I evaluate System.Threading.Thread.CurrentThread.ApartmentState in the debugger I always get STA, even right after I run System.Threading.Thread.CurrentThread.ApartmentState = ApartmentState.MTA. Maybe it is a VS.NET quirk.

 

I’ll have to run some more tests to see if the hangs went away.

 

Tibor

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Sheppard
Sent: Friday, February 24, 2006 2:46 PM
To: Tibor Biro
Cc: Krishna; Jonathan Mitchem; [email protected]; [email protected]
Subject: Re: [Alchemi-users] Re: [Alchemi-developers] Grid-based Malware

 

Tibor,
   Are you sure you don't have a threading issue?  Do you ever get this problem on a hyperthreaded or multi cpu machine?  The reason why I ask is I have seen the hanging thread issue before.  What was happening in my case is that on a single cpu'ed machine without hyperthreading threads would appear to hang.  So lets say I fired up 10 threads to handle an some work units one would run while 9 would 'seamiingly' hang.  What was going on is that even though I had marked the Main entry point with the MTAThread attribute that applied only COM related apartment threading.  So on the single cpu it was running the threads sequentially.  So if I had 1000 items to process 991 of them would get processed.  The last 9 would never return.  I could bring up the threads view in the debugger and see them but they would always be waiting on their MRE's.  So in the main method as a measure of desperation I put in the command of System.Threading.Thread.CurrentThread.ApartmentState = ApartmentState.MTA and everything started working.  You might want to check this if you using more than one thread in the appdomain.  Hope this helps.

John

 

Reply via email to