E
Elizabeth Harmon
Hi All
I am just double checking myself here.
I have two threads that i am running in an application, One Thread Updates a
client side Table in a local DB, another Updates a Server Side Table on a
Server DB (I know i dont like it either but for some reason they want two
seperate DB's, go figure!!)
Anyway, I use the following code to Kick off the Threads:
'While the thread state is running, loop until it is
stopped
While intRunningState <> connThread.ThreadState.Stopped
Or intRunningState2 <> connUpldThread.ThreadState.Stopped
If Not blnIsRunning Then
'Writer Updates the Screen for the User
WriteStatusUpdate(writer, "<BR><FONT
color='blue'>Retrieving Records, Please Wait....</FONT>", True)
blnIsRunning = True
connThread.Start()
intRunningState = connThread.ThreadState
connThread.Join()
connUpldThread.Start()
connUpldThread.Join()
intRunningState2 = connUpldThread.ThreadState
End If
intRunningState = connThread.ThreadState
intRunningState2 = connUpldThread.ThreadState
If connUpldThread.ThreadState = 0 Then
'Writer Updates the Screen for the User
WriteStatusUpdate(writer, "<BR><FONT
color='blue'>Sending Records, Please Wait....</FONT>", True)
End If
End While
What i want to know is, am i using the Join statement Correctly? I do want
one Thread to finish before the other starts in an effort to co-ordinate
this process. Please let me know
Thanks in advance
Samantha
I am just double checking myself here.
I have two threads that i am running in an application, One Thread Updates a
client side Table in a local DB, another Updates a Server Side Table on a
Server DB (I know i dont like it either but for some reason they want two
seperate DB's, go figure!!)
Anyway, I use the following code to Kick off the Threads:
'While the thread state is running, loop until it is
stopped
While intRunningState <> connThread.ThreadState.Stopped
Or intRunningState2 <> connUpldThread.ThreadState.Stopped
If Not blnIsRunning Then
'Writer Updates the Screen for the User
WriteStatusUpdate(writer, "<BR><FONT
color='blue'>Retrieving Records, Please Wait....</FONT>", True)
blnIsRunning = True
connThread.Start()
intRunningState = connThread.ThreadState
connThread.Join()
connUpldThread.Start()
connUpldThread.Join()
intRunningState2 = connUpldThread.ThreadState
End If
intRunningState = connThread.ThreadState
intRunningState2 = connUpldThread.ThreadState
If connUpldThread.ThreadState = 0 Then
'Writer Updates the Screen for the User
WriteStatusUpdate(writer, "<BR><FONT
color='blue'>Sending Records, Please Wait....</FONT>", True)
End If
End While
What i want to know is, am i using the Join statement Correctly? I do want
one Thread to finish before the other starts in an effort to co-ordinate
this process. Please let me know
Thanks in advance
Samantha