473,327 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Aborting a thread based on the Timer

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
Jul 21 '05 #1
1 1280
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" <si*******@gmail.com> wrote in message
news:ec**************************@posting.google.c om...
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

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jason | last post by:
I have a job created on my server which runs a stored procedure. The SP uses a cursor on a recordset to insert rows into a table (via a stored procedure - hence the cursor). It is expected that...
1
by: johnny | last post by:
In a multi-threaded application, say a worker thread makes an asynchronous call and specifies a callback method. But before the callback is executed, the thread is aborted by its creator. What is...
2
by: Amadej | last post by:
Hello everyone I have a beginner's questions about the System.Threading.Timer class behavior. I have been observing the thread count with Windows Task Manger and noticed that timers, after being...
3
by: Jeff Greenland | last post by:
Hello everyone, I am having problems with Timers in a web application. They just seem to stop running after 15 minutes or so. My web application is set up like this: When a user hits a...
4
by: Todd | last post by:
I have an ASP.NET application and I would like to have some code run on the server automatically once a day at a specified time. I create a timer thread to call a simple callback in the...
1
by: siva sanks | last post by:
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...
7
by: archana | last post by:
Hi all, I am having application in which i am doing asynchronous call.I am using manualresetevent to wait for asynchronous call to complete. I want to stop asynchronous call after certain...
5
by: Tony Gravagno | last post by:
I have a class that instantiates two Timer objects that fire at different intervals. My class can be instantiated within a Windows Form or from a Windows Service. Actions performed by one of the...
3
by: AdrianDev | last post by:
Hi, I have a thread which I call like this: // Allocate a new thread containing class with the host getInfoThread git = new getInfoThread(host); // Create the thread and call the Go method...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.