473,473 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Threads question

I need to learn about threads and threading. I currently have a process
that is pulling 10 to 12 thousand records from the AS400 and formatting the
data then storing into a SQL server. This process is taking just over one
hour and I would like a progress bar or something to show that it is
actually working and I guess this would be done using threads.

Can somebody give me a link to some good starter information on threads

If it makes a difference, I am using VB .Net.

Thanks,

Brad
Nov 21 '05 #1
10 1394
To save yourself a lot of trouble, in the main program, in the loop, update
your progress bar and call Application.DoEvents().
Calling Application.DoEvents allow windows controls to be updated during the
processing, your form can be minimized, etc.
Threads can not update UI controls directly, the main thread has to wait for
other threads to terminate when terminating the app, etc.

"Brad" <ba******@ukcdogs.com> wrote in message
news:eg**************@tk2msftngp13.phx.gbl...
I need to learn about threads and threading. I currently have a process
that is pulling 10 to 12 thousand records from the AS400 and formatting
the
data then storing into a SQL server. This process is taking just over one
hour and I would like a progress bar or something to show that it is
actually working and I guess this would be done using threads.

Can somebody give me a link to some good starter information on threads

If it makes a difference, I am using VB .Net.

Thanks,

Brad

Nov 21 '05 #2
To save yourself a lot of trouble, in the main program, in the loop, update
your progress bar and call Application.DoEvents().
Calling Application.DoEvents allow windows controls to be updated during the
processing, your form can be minimized, etc.
Threads can not update UI controls directly, the main thread has to wait for
other threads to terminate when terminating the app, etc.

"Brad" <ba******@ukcdogs.com> wrote in message
news:eg**************@tk2msftngp13.phx.gbl...
I need to learn about threads and threading. I currently have a process
that is pulling 10 to 12 thousand records from the AS400 and formatting
the
data then storing into a SQL server. This process is taking just over one
hour and I would like a progress bar or something to show that it is
actually working and I guess this would be done using threads.

Can somebody give me a link to some good starter information on threads

If it makes a difference, I am using VB .Net.

Thanks,

Brad

Nov 21 '05 #3
Chris,

Thanks for the advice. That is exactly what I needed and it is working
fine.

Brad
"Chris Botha" <chris_s_botha@.AT.hotmail.com> wrote in message
news:O$**************@TK2MSFTNGP10.phx.gbl...
To save yourself a lot of trouble, in the main program, in the loop,
update your progress bar and call Application.DoEvents().
Calling Application.DoEvents allow windows controls to be updated during
the processing, your form can be minimized, etc.
Threads can not update UI controls directly, the main thread has to wait
for other threads to terminate when terminating the app, etc.

"Brad" <ba******@ukcdogs.com> wrote in message
news:eg**************@tk2msftngp13.phx.gbl...
I need to learn about threads and threading. I currently have a process
that is pulling 10 to 12 thousand records from the AS400 and formatting
the
data then storing into a SQL server. This process is taking just over
one
hour and I would like a progress bar or something to show that it is
actually working and I guess this would be done using threads.

Can somebody give me a link to some good starter information on threads

If it makes a difference, I am using VB .Net.

Thanks,

Brad


Nov 21 '05 #4
Chris,

Thanks for the advice. That is exactly what I needed and it is working
fine.

Brad
"Chris Botha" <chris_s_botha@.AT.hotmail.com> wrote in message
news:O$**************@TK2MSFTNGP10.phx.gbl...
To save yourself a lot of trouble, in the main program, in the loop,
update your progress bar and call Application.DoEvents().
Calling Application.DoEvents allow windows controls to be updated during
the processing, your form can be minimized, etc.
Threads can not update UI controls directly, the main thread has to wait
for other threads to terminate when terminating the app, etc.

"Brad" <ba******@ukcdogs.com> wrote in message
news:eg**************@tk2msftngp13.phx.gbl...
I need to learn about threads and threading. I currently have a process
that is pulling 10 to 12 thousand records from the AS400 and formatting
the
data then storing into a SQL server. This process is taking just over
one
hour and I would like a progress bar or something to show that it is
actually working and I guess this would be done using threads.

Can somebody give me a link to some good starter information on threads

If it makes a difference, I am using VB .Net.

Thanks,

Brad


Nov 21 '05 #5
Brad,

The way you get it from the AS400 is important to answer your question, so
how do you do that.

I do now not see the needs for threads, that could be when you were getting
it from more AS400's.
(And the process of the AS400's are than slower than from your processing
computer)

Cor
Nov 21 '05 #6
Brad,

The way you get it from the AS400 is important to answer your question, so
how do you do that.

I do now not see the needs for threads, that could be when you were getting
it from more AS400's.
(And the process of the AS400's are than slower than from your processing
computer)

Cor
Nov 21 '05 #7
Cor,

I am using an ODBC dataset to pull in the data from the AS400. For each row
I am formatting the data to match how we need it for this particular project
and that data is being saved in an MSDE SQL database. It is a really slow
process.

Brad
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Brad,

The way you get it from the AS400 is important to answer your question, so
how do you do that.

I do now not see the needs for threads, that could be when you were
getting it from more AS400's.
(And the process of the AS400's are than slower than from your processing
computer)

Cor

Nov 21 '05 #8
Cor,

I am using an ODBC dataset to pull in the data from the AS400. For each row
I am formatting the data to match how we need it for this particular project
and that data is being saved in an MSDE SQL database. It is a really slow
process.

Brad
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Brad,

The way you get it from the AS400 is important to answer your question, so
how do you do that.

I do now not see the needs for threads, that could be when you were
getting it from more AS400's.
(And the process of the AS400's are than slower than from your processing
computer)

Cor

Nov 21 '05 #9
Brad,

This is of course a typical a process for a queu as you describe it.

However first you have to find out if the slow processes are on both end of
the queu or that it is only one point.

When the action will be that the AS400 process is always filling an empty
queu or that the SQL process is always waiting on a filled queu, than you
will only create overhead and probably win maximum the processing of one
records on either side. That time you will loose with polling the queu.

In other words both processes have to be both slow and that slow has to be
because of the external part.

When you want a progress bar, that is very easy, you needs to know the
records what is the max value and the steps 1/recordcount and than you can
every time perform a step when you insert a record in your sql server.

Just some thoughts

Cor


Nov 21 '05 #10
Brad,

This is of course a typical a process for a queu as you describe it.

However first you have to find out if the slow processes are on both end of
the queu or that it is only one point.

When the action will be that the AS400 process is always filling an empty
queu or that the SQL process is always waiting on a filled queu, than you
will only create overhead and probably win maximum the processing of one
records on either side. That time you will loose with polling the queu.

In other words both processes have to be both slow and that slow has to be
because of the external part.

When you want a progress bar, that is very easy, you needs to know the
records what is the max value and the steps 1/recordcount and than you can
every time perform a step when you insert a record in your sql server.

Just some thoughts

Cor


Nov 21 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tzach | last post by:
I'm developing a simple Java client that runs over a CORBA server. The main client thread is waiting for notification from this server. On each notification, The client creates a new thread...
2
by: grahamo | last post by:
Hi, I realise that c++ knows nothing about threads however my question is related to an (excellent) article I was reading about threads and C++. For all intents and purposes we can forget the...
10
by: [Yosi] | last post by:
I would like to know how threads behavior in .NET . When an application create 4 threads for example start all of them, the OS task manager will execute all 4 thread in deterministic order manes,...
1
by: Raoul Minder | last post by:
Hi all I am new to threading! I am developping a newsletter tool including a dispatch manager that should schedule sendings. The Web layer kicks a remote object hosted by a windows service...
14
by: Lior Amar | last post by:
Quick question about threads and delegates. I have the following scenario Thread A (CLASSA) spawns Thread B (CLASSB) and passes it a DelegateA to a callback Thread B Invokes a DelegateB...
10
by: cj | last post by:
I'm writing a TCP/IP server app that will have many simultaneous connections. The main thread listens for new connections and starts a thread to handle each requested connection. These are short...
7
by: Michael | last post by:
I'm writing an application that decodes a file containing binary records. Each record is a particular event type. Each record is translated into ASCII and then written to a file. Each file contains...
1
by: | last post by:
I'm trying to think something through and am wondering if may have some suggestions. I am building a Windows service (VStudio 2005, C#) that uses a COM component to answer a telephone call(s). ...
4
by: gsimmons | last post by:
I've been researching multi-threaded WinForms apps and thread synchronization stuff for a couple days since I'm working on refactoring a multi-threaded GUI app at work and want to be sure it's...
1
by: chunghorng_lung | last post by:
Hi All, I have a question on the scope of variables for threads. The program has a main thread which creates a few worker threads. The main thread can access another class stored in another...
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
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...
1
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.