Home All Groups Group Topic Archive Search About
Author
17 Jan 2006 5:23 PM
VB.NET
Good Afternoon,  Is it possible to start a thread with threadpool and either
abort it or set a timeout to kill the thread if it goes longer than a given
amount of time?

Author
18 Jan 2006 1:07 AM
Rocky
'-- Put in thread
Dim start As DateTime = DateTime.Now
'-- In minutes
Const timeout As Integer = 1

Do While DateTime.Now.Subtract(start).TotalMinutes < timeout

'-- Do work

Loop





Show quoteHide quote
"VB.NET" <AA***@AAAAA.ORG> wrote in message
news:YOOdnQHOAL9wulDenZ2dnUVZ_t-dnZ2d@comcast.com...
> Good Afternoon,  Is it possible to start a thread with threadpool and
> either abort it or set a timeout to kill the thread if it goes longer than
> a given amount of time?
>
Author
18 Jan 2006 3:00 AM
VB.NET
That will loop through the '-- Do Work.  I want the code to run once.  Also,
it would only jump out of the loop when it got to the end and the initial
conditions were not met.  I need it to kill it if it hangs on function.
Thanks for the input, however.

Show quoteHide quote
"Rocky" <nopl***@nowhere.com> wrote in message
news:uJrELu8GGHA.3532@TK2MSFTNGP14.phx.gbl...
>
> '-- Put in thread
> Dim start As DateTime = DateTime.Now
> '-- In minutes
> Const timeout As Integer = 1
>
> Do While DateTime.Now.Subtract(start).TotalMinutes < timeout
>
> '-- Do work
>
> Loop
>
>
>
>
>
> "VB.NET" <AA***@AAAAA.ORG> wrote in message
> news:YOOdnQHOAL9wulDenZ2dnUVZ_t-dnZ2d@comcast.com...
>> Good Afternoon,  Is it possible to start a thread with threadpool and
>> either abort it or set a timeout to kill the thread if it goes longer
>> than a given amount of time?
>>
>
>
Author
18 Jan 2006 3:08 AM
Rocky
Just exit out of the thread then if the conditions aren't met.


Show quoteHide quote
"VB.NET" <AA***@AAAAA.ORG> wrote in message
news:VqadnUm68YrNMlDenZ2dnUVZ_tydnZ2d@comcast.com...
> That will loop through the '-- Do Work.  I want the code to run once.
> Also, it would only jump out of the loop when it got to the end and the
> initial conditions were not met.  I need it to kill it if it hangs on
> function. Thanks for the input, however.
>
> "Rocky" <nopl***@nowhere.com> wrote in message
> news:uJrELu8GGHA.3532@TK2MSFTNGP14.phx.gbl...
>>
>> '-- Put in thread
>> Dim start As DateTime = DateTime.Now
>> '-- In minutes
>> Const timeout As Integer = 1
>>
>> Do While DateTime.Now.Subtract(start).TotalMinutes < timeout
>>
>> '-- Do work
>>
>> Loop
>>
>>
>>
>>
>>
>> "VB.NET" <AA***@AAAAA.ORG> wrote in message
>> news:YOOdnQHOAL9wulDenZ2dnUVZ_t-dnZ2d@comcast.com...
>>> Good Afternoon,  Is it possible to start a thread with threadpool and
>>> either abort it or set a timeout to kill the thread if it goes longer
>>> than a given amount of time?
>>>
>>
>>
>
>
Author
18 Jan 2006 10:59 PM
VB.NET
It get's stuck on data downloads from webservices.  It's one line:
xmldocument.load(site).  if the server is too busy or the connection isn't
great, it locks up.  Thats why i want to kill a threadpool.

Show quoteHide quote
"Rocky" <nopl***@nowhere.com> wrote in message
news:%23kCiBy9GGHA.3064@TK2MSFTNGP10.phx.gbl...
> Just exit out of the thread then if the conditions aren't met.
>
>
> "VB.NET" <AA***@AAAAA.ORG> wrote in message
> news:VqadnUm68YrNMlDenZ2dnUVZ_tydnZ2d@comcast.com...
>> That will loop through the '-- Do Work.  I want the code to run once.
>> Also, it would only jump out of the loop when it got to the end and the
>> initial conditions were not met.  I need it to kill it if it hangs on
>> function. Thanks for the input, however.
>>
>> "Rocky" <nopl***@nowhere.com> wrote in message
>> news:uJrELu8GGHA.3532@TK2MSFTNGP14.phx.gbl...
>>>
>>> '-- Put in thread
>>> Dim start As DateTime = DateTime.Now
>>> '-- In minutes
>>> Const timeout As Integer = 1
>>>
>>> Do While DateTime.Now.Subtract(start).TotalMinutes < timeout
>>>
>>> '-- Do work
>>>
>>> Loop
>>>
>>>
>>>
>>>
>>>
>>> "VB.NET" <AA***@AAAAA.ORG> wrote in message
>>> news:YOOdnQHOAL9wulDenZ2dnUVZ_t-dnZ2d@comcast.com...
>>>> Good Afternoon,  Is it possible to start a thread with threadpool and
>>>> either abort it or set a timeout to kill the thread if it goes longer
>>>> than a given amount of time?
>>>>
>>>
>>>
>>
>>
>
>