473,399 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 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 2289
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jean-Yves Nief | last post by:
hello, I have written a script which is performing some tasks in multithreading mode: the main thread is opening a connection to a distant server and all the threads that I start will have to...
1
by: dixp | last post by:
I'm new to writing multithreaded apps and I have a design question. I have a winforms app and a class which has a method that does processing which is time intensive. I want the user to be able...
0
by: GianGuz | last post by:
In the following example Global is able to create and manage access to objects of any kind (even in a multithreading environment) with and index value attached to. So a Global<0, string> is a...
11
by: Mark Yudkin | last post by:
The documentation is unclear (at least to me) on the permissibility of accessing DB2 (8.1.5) concurrently on and from Windows 2000 / XP / 2003, with separate transactions scope, from separate...
16
by: Robert Zurer | last post by:
Can anyone suggest the best book or part of a book on this subject. I'm looking for an in-depth treatment with examples in C# TIA Robert Zurer robert@zurer.com
10
by: Marek | last post by:
Hi, I am analyzing Duwamish7 source code boundled with Visual Studio .NET 2003. Could anoybody explain why the Monitor.Enter and Monitor.Exit block is used inside a static constructor? The code...
2
by: Multithreading problem in vb.net | last post by:
Greetings, I am new to multithreading and I am trying to implement it in my app. This application is distributed application which needs to refresh every say 5 secs to show some activities in...
6
by: MeowCow | last post by:
I will try and make my question with out being too long winded. I have been doing a lot of reading on how to do multithreading and I have implemented the code from the following example on...
7
by: Ray | last post by:
Hello, Greetings! I'm looking for a solid C++ multithreading book. Can you recommend one? I don't think I've seen a multithreading C++ book that everybody thinks is good (like Effective C++ or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.