Hi all
i'm facing a problem with multiple timers where i have two different type of functionalities for timers with the same interval, so in order to achieve asynchronous exection i'm using System.Timers.Timer where these timers will be created on Server(system) thread but not on application thread.
so i have two long running functions.when i tried to invoke them in two different timers,here in my case 2nd timer is waiting for 1st timer to complete its execution so i was unable to make them asynchronous, still they are running in que but not in parllel
here is my raw code
--------------------------------------------
Public Class MainForm
Private Shared CrTimer As New System.Timers.Timer()
Private Shared QfTimer As New System.Timers.Timer()
Delegate Sub SetTextCallback(ByVal [text] As String)
Delegate Sub SetTextCallback1(ByVal [text] As String)
Private sub MainForm_Load
AddHandler QfTimer.Elapsed, AddressOf QfTimer_Tick
AddHandler CrTimer.Elapsed, AddressOf CrTimer_Tick
QfTimer.Interval =1000000
CrTimer,Interval =1000000
QfTimer.Start()
CrTimer.Start()
End sub
Private Sub CrTimer_Tick()
Dim d As New SetTextCallback(AddressOf DisableCrewControls)
Dim ds As String = "disable"
Me.BeginInvoke(d, New Object() {[ds]})
End Sub
Private Sub QfTimer_Tick()
Dim d As New SetTextCallback1(AddressOf DisableQfileControls)
Dim ds As String = "disable"
Me.BeginInvoke(d, New Object() {[ds]})
End Sub
Private Sub DisableQfileControls(ByVal param As String)
// reading more than 1000 CSV files
End Sub
Private Sub DisableCrewControls(ByVal param As String)
// reading more than 1000 Excell files
End Sub
End class
---------------------------------------------
Kindly suggest me on it
Thanks in advance.......