HighTechTalks DotNet Forums  

Thread.Abort and Remoting

Dotnet Framework (Remoting) microsoft.public.dotnet.framework.remoting


Discuss Thread.Abort and Remoting in the Dotnet Framework (Remoting) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Howard Swope
 
Posts: n/a

Default Thread.Abort and Remoting - 11-01-2006 , 11:20 AM






..Net 1.1

On the currently executing thread, I create a new thread and start it. The
current thread waits for the new thread to complete execution or for a
timeout period. On timeout I call Thread.Abort on the new thread.

The new thread goes into a try - finally block in which it makes a remoting
call. I want the finally block to execute when I call thread abort, but the
thread is hung waiting for the remoting call to return and the finally code
never gets run.

What is going on here?

PsuedoCode:

CurrentThread
{
Thread newThread = Thread(new ThreadStart(NewThread))
bool timedout;
CompleteEvent.Wait(timeout, ref timedout)
if (timedout)
{
newThread.Abort()
}
}


NewThread()
{
try
{
RemoteObject.DoWork()
CompleteEvent.Signal
}
finally
{
CleanupCode
}
}

--
Howard Swope [hswopeATtrafficDOTcom]
Software Engineer
Media Development
Traffic.com [http://www.traffic.com]



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.