|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Threadpool timeoutGood 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? '-- 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? > 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? >> > > 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? >>> >> >> > > 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? >>>> >>> >>> >> >> > >
Problem with SHAppBarMessage
The Irish fada (áéíóú/ÁÉÍÓÚ) and encryption/decryption problem! How to create a "DataSource" & "Items" properties on Custom Combob Binding sources question in Vs2005 Detect Remote Shutdown Alignment problem displaying .txt file in window's textbox? Impersonation without credentials ? BUG? SqlDecimal = Single/Double: 4.475 becomes 4.4749999999999996D ???? Encyrption in VB and Decryption in VB.NET DataTable.Expression |
|||||||||||||||||||||||