PC Review


Reply
Thread Tools Rate Thread

Aborting a thread based on the Timer

 
 
siva sanks
Guest
Posts: n/a
 
      6th Aug 2004
Hello,

I have a situation, in which, we would be calling the external
interfaces from our application. For some reason, the external
interface call doesnt produce any time outs and it hangs for ever. We
are thinking of spawning a call to the external interface in a thread,
and if it exceeds certain amount time, we would like to abort the
thread, so that our main execution wont keep on waiting for the
response from the external interface.

Is this is a good approach? Is there any better way tohandle the
same? Anycode sample to do the thread abort based on the timer class
would be greatly appreciated.

Thanks,
Shankar
 
Reply With Quote
 
 
 
 
David Levine
Guest
Posts: n/a
 
      7th Aug 2004
Simply injecting an abort on another thread is no guarantee that the thread
will actually be aborted. If the thread is executing unmanaged code the
abort will not actually be delivered until the unmanaged code returns back
into the managed environment. However, if the thread is blocked on a managed
object then you should be able to abort it.

"siva sanks" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> I have a situation, in which, we would be calling the external
> interfaces from our application. For some reason, the external
> interface call doesnt produce any time outs and it hangs for ever. We
> are thinking of spawning a call to the external interface in a thread,
> and if it exceeds certain amount time, we would like to abort the
> thread, so that our main execution wont keep on waiting for the
> response from the external interface.
>
> Is this is a good approach? Is there any better way tohandle the
> same? Anycode sample to do the thread abort based on the timer class
> would be greatly appreciated.
>
> Thanks,
> Shankar



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Thread.Abort not really aborting thread. Mufasa Microsoft C# .NET 4 12th Jun 2007 05:40 PM
Aborting a thread ? jmd.msdn Microsoft C# .NET 3 6th Jan 2006 07:15 PM
Thread .Aborting Xarky Microsoft C# .NET 2 8th Mar 2005 05:44 PM
aborting a thread in C# =?Utf-8?B?QWJoaW5hdiBQYXRoYWs=?= Microsoft C# .NET 1 24th Dec 2004 10:56 AM
Aborting a Thread =?Utf-8?B?RG9taW5payBIYW5lYmVyZw==?= Microsoft Dot NET Compact Framework 4 18th Feb 2004 06:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:21 PM.