Repeat Events & Background Processing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I working on a system that every few minutes will have to perform an action (perhaps large database query or even dialing into a remote machine). Obviously i want this to be invisable to the user.

Right now i'm using the folowing to peform this - it seems to work but it's not very glamorous, and is only an example - perhaps performance would degrade if it was contacting a machine via modem (SayHellow) is the starting point of a thread).

Public Sub SayHello()
While True
Debug.WriteLine("Active: " & Thread.CurrentThread.Name & " " & Now)
Dim i As Integer
For i = 0 To 1000000
i = i
Next
Thread.Sleep(10000 * 240)
End While
End Sub

But i've been reading up on Thread.Timers - would these be better/less nasty than my exisitng solution?

Andrew
 
Yes.
______________________________
The Grim Reaper

Andrew Olden said:
Hi All,

I working on a system that every few minutes will have to perform an
action (perhaps large database query or even dialing into a remote machine).
Obviously i want this to be invisable to the user.
Right now i'm using the folowing to peform this - it seems to work but
it's not very glamorous, and is only an example - perhaps performance would
degrade if it was contacting a machine via modem (SayHellow) is the starting
point of a thread).
Public Sub SayHello()
While True
Debug.WriteLine("Active: " & Thread.CurrentThread.Name & " " & Now)
Dim i As Integer
For i = 0 To 1000000
i = i
Next
Thread.Sleep(10000 * 240)
End While
End Sub

But i've been reading up on Thread.Timers - would these be better/less
nasty than my exisitng solution?
 
Back
Top