R
Rich
Hello,
I have set up a multithreading routine in a Test VB.net
proj, and it appears to be working OK in debug mode and I
am not using synchronization. Multithreading is a new
thing for me, and I just wanted to ask if I am missing
anything based on the following scenario.
My test app pulls data from a large external data source
which has a table-like structure (but not rdbms - more
like a text file - but can't use DTS or ODBC). Well,
there IS an index in the source data, so I can pull
records 1-4000 and simultaneously pull 4001-8000 from 2
different processes on the same data source (there are
many more records than this - but I am testing right
now). It takes about 1.5 minutes to pull 8000 records
with one process. With 2 processes the time is reduced to
56 seconds (consistently). So multithreading appears to
enhance the data pull. Here is how I call the processes:
Module Level
Public t1 As Thread, t2 As Thread
Form Code
sub startProcess
....
t1 = New Thread(AddressOf Me.Form2Show)
t2 = New Thread(AddressOf Me.Form3show)
t1.Start()
t2.Start()
....
End Sub
Sub Form2Show()
Dim frm As New Form2
frm.Show()
Application.Run(frm)
End Sub
Sub Form3Show()
Dim frm As New Form3
frm.Show()
Application.Run(frm)
End Sub
....
When Form2Show and Form3Show have completed pulling their
data, I close the forms. But in the Debug window I see
this message about every minute:
The thread '<No Name>' (0x6c8) has exited with code 0
(0x0).
The thread '<No Name>' (0xbf0) has exited with code 0
(0x0).
The thread '<No Name>' (0xc84) has exited with code 0
(0x0).
....
Do I need to be concerned about this ongoing message? The
gameplan is that my app will be running continuously and
will invoke the data puller Forms once a day then shut
down the data pullers and re-invoke them the next day,
etc. Do I need to end the threads after the routines are
done? Can I leave the app the way it is? Do I need to
worry about synchronization in this scenario? Any
suggestions appreciated about multithreading with the
above.
TIA
Rich
I have set up a multithreading routine in a Test VB.net
proj, and it appears to be working OK in debug mode and I
am not using synchronization. Multithreading is a new
thing for me, and I just wanted to ask if I am missing
anything based on the following scenario.
My test app pulls data from a large external data source
which has a table-like structure (but not rdbms - more
like a text file - but can't use DTS or ODBC). Well,
there IS an index in the source data, so I can pull
records 1-4000 and simultaneously pull 4001-8000 from 2
different processes on the same data source (there are
many more records than this - but I am testing right
now). It takes about 1.5 minutes to pull 8000 records
with one process. With 2 processes the time is reduced to
56 seconds (consistently). So multithreading appears to
enhance the data pull. Here is how I call the processes:
Module Level
Public t1 As Thread, t2 As Thread
Form Code
sub startProcess
....
t1 = New Thread(AddressOf Me.Form2Show)
t2 = New Thread(AddressOf Me.Form3show)
t1.Start()
t2.Start()
....
End Sub
Sub Form2Show()
Dim frm As New Form2
frm.Show()
Application.Run(frm)
End Sub
Sub Form3Show()
Dim frm As New Form3
frm.Show()
Application.Run(frm)
End Sub
....
When Form2Show and Form3Show have completed pulling their
data, I close the forms. But in the Debug window I see
this message about every minute:
The thread '<No Name>' (0x6c8) has exited with code 0
(0x0).
The thread '<No Name>' (0xbf0) has exited with code 0
(0x0).
The thread '<No Name>' (0xc84) has exited with code 0
(0x0).
....
Do I need to be concerned about this ongoing message? The
gameplan is that my app will be running continuously and
will invoke the data puller Forms once a day then shut
down the data pullers and re-invoke them the next day,
etc. Do I need to end the threads after the routines are
done? Can I leave the app the way it is? Do I need to
worry about synchronization in this scenario? Any
suggestions appreciated about multithreading with the
above.
TIA
Rich