471,073 Members | 1,158 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,073 software developers and data experts.

Multithreading Question

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
Nov 20 '05 #1
2 2134
I wouldn't worry about the messages. I think it is just part of GC doing
it's thing.
"Rich" <an*******@discussions.microsoft.com> wrote in message
news:1f*****************************@phx.gbl...
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

Nov 20 '05 #2
Thanks. I'm just experimenting right now. I think
bandwidth may be another issue with multithreading.

-----Original Message-----
I wouldn't worry about the messages. I think it is just part of GC doingit's thing.
"Rich" <an*******@discussions.microsoft.com> wrote in messagenews:1f*****************************@phx.gbl...
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

.

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jean-Yves Nief | last post: by
1 post views Thread by dixp | last post: by
16 posts views Thread by Robert Zurer | last post: by
10 posts views Thread by Marek | last post: by
2 posts views Thread by Multithreading problem in vb.net | last post: by
7 posts views Thread by Ray | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.