Dear All,
I stuck in using thread. some time it abort all active thread and some the thread didn't invoke.
Below is the logic i am trying achieve....
I have one function which have DB connection and some business calculation and this function is always executed within 2 sec interval time using timer
I managed to execute using thread and it work but i have issue in Aborting some time it abort all active thread....
I stuck in using thread. some time it abort all active thread and some the thread didn't invoke.
Below is the logic i am trying achieve....
I have one function which have DB connection and some business calculation and this function is always executed within 2 sec interval time using timer
I managed to execute using thread and it work but i have issue in Aborting some time it abort all active thread....
Code:
Dim Rcthread As Thread
Rcthread = New Threading.Thread(AddressOf CalculateTrx)
Rcthread.IsBackground = True
Rcthread.Start(Rcthread)
Thread.Sleep(1000)
SyncLock Rcthread
Rcthread.Abort()
Rcthread = Nothing
End SyncLock