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 | | | | re: Threads question
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" <ballison@ukcdogs.com> wrote in message
news:egDfpgIBFHA.3528@tk2msftngp13.phx.gbl...[color=blue]
>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
>
>[/color] | | | | re: Threads question
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" <ballison@ukcdogs.com> wrote in message
news:egDfpgIBFHA.3528@tk2msftngp13.phx.gbl...[color=blue]
>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
>
>[/color] | | | | re: Threads question
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$C9huIBFHA.3512@TK2MSFTNGP10.phx.gbl...[color=blue]
> 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" <ballison@ukcdogs.com> wrote in message
> news:egDfpgIBFHA.3528@tk2msftngp13.phx.gbl...[color=green]
>>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
>>
>>[/color]
>
>[/color] | | | | re: Threads question
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$C9huIBFHA.3512@TK2MSFTNGP10.phx.gbl...[color=blue]
> 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" <ballison@ukcdogs.com> wrote in message
> news:egDfpgIBFHA.3528@tk2msftngp13.phx.gbl...[color=green]
>>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
>>
>>[/color]
>
>[/color] | | | | re: Threads question
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 | | | | re: Threads question
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 | | | | re: Threads question
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" <notmyfirstname@planet.nl> wrote in message
news:%23SWVOGJBFHA.3820@TK2MSFTNGP11.phx.gbl...[color=blue]
> 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
>[/color] | | | | re: Threads question
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" <notmyfirstname@planet.nl> wrote in message
news:%23SWVOGJBFHA.3820@TK2MSFTNGP11.phx.gbl...[color=blue]
> 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
>[/color] | | | | re: Threads question
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 | | | | re: Threads question
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 |  | Similar Visual Basic .NET bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,419 network members.
|