Taking Advantage of Additional Processors - Programmer
This is a discussion on Taking Advantage of Additional Processors - Programmer ; Hi,
I'm aware that Wink2k does support 2 or more processors. Will a program
developed using VB6 be able to take advantage of the additional processing
power if I add more processors? Do I need to install any service pack ...
-
Taking Advantage of Additional Processors
Hi,
I'm aware that Wink2k does support 2 or more processors. Will a program
developed using VB6 be able to take advantage of the additional processing
power if I add more processors? Do I need to install any service pack from
microsoft? Do I need to re-design and re-code my program?
Thanks,
chew
-
Re: Taking Advantage of Additional Processors
No, not directly. A vb app is single-threaded, so uses one processor. What
you will find however is that with 2 processors, a task that maxes the
processor at 100% will be equally divided across two processors, allowing
you to do other things while the process-intensive task runs.
--
Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.
"Chew" wrote in message
news:bm0235$490$1@nobel2.pacific.net.sg...
: Hi,
:
: I'm aware that Wink2k does support 2 or more processors. Will a program
: developed using VB6 be able to take advantage of the additional processing
: power if I add more processors? Do I need to install any service pack from
: microsoft? Do I need to re-design and re-code my program?
:
: Thanks,
: chew
:
:
-
Re: Taking Advantage of Additional Processors
If a VB app is running in a continuous processor intensive loop then task manager will show 50% cpu usage. To fix this you need to
use API to create a second thread, or you can just run a second copy of your app.
--
Michael Culley
"Chew" wrote in message news:bm0235$490$1@nobel2.pacific.net.sg...
> Hi,
>
> I'm aware that Wink2k does support 2 or more processors. Will a program
> developed using VB6 be able to take advantage of the additional processing
> power if I add more processors? Do I need to install any service pack from
> microsoft? Do I need to re-design and re-code my program?
>
> Thanks,
> chew
>
>
-
Re: Taking Advantage of Additional Processors
Thanks Randy. Would like to clarify your point. Do you mean the VB program
will only utilise the additional processors if the CPU usage of the primary
processor hits 100%? And all these are controlled by the Windows OS? I
visited Microsoft website and found the Visual C++ processor pack to support
ehanced instruction sets. Do I need this service pack? Is there a VB6
version?
"Randy Birch" wrote in message
news:#dWeaEVjDHA.3312@tk2msftngp13.phx.gbl...
> No, not directly. A vb app is single-threaded, so uses one processor. What
> you will find however is that with 2 processors, a task that maxes the
> processor at 100% will be equally divided across two processors, allowing
> you to do other things while the process-intensive task runs.
>
> --
>
> Randy Birch
> MVP Visual Basic
> http://www.mvps.org/vbnet/
> Please respond only to the newsgroups so all can benefit.
>
>
> "Chew" wrote in message
> news:bm0235$490$1@nobel2.pacific.net.sg...
> : Hi,
> :
> : I'm aware that Wink2k does support 2 or more processors. Will a program
> : developed using VB6 be able to take advantage of the additional
processing
> : power if I add more processors? Do I need to install any service pack
from
> : microsoft? Do I need to re-design and re-code my program?
> :
> : Thanks,
> : chew
> :
> :
>
>
-
Re: Taking Advantage of Additional Processors
You can use an API called SetThreadAffinity to make the OS prefer one
processor over the other one. But as Randy said, you're always limited to
one thread so it doesn't help too much.
In general this is something you don't do even if you're writing C++ and
creating threads manually. Depending on what you're doing there are ways to
let the OS optimize thread timeslices across more than one CPU.
My advise would be to not worry about that... Windows is smart enough to
shift load around when it needs to.
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/
Please post/reply to the newsgroup(s)
"Chew" wrote in message
news:bm0235$490$1@nobel2.pacific.net.sg...
> Hi,
>
> I'm aware that Wink2k does support 2 or more processors. Will a program
> developed using VB6 be able to take advantage of the additional processing
> power if I add more processors? Do I need to install any service pack from
> microsoft? Do I need to re-design and re-code my program?
>
> Thanks,
> chew
>
>
-
Re: Taking Advantage of Additional Processors
If I've a number of processes running on the Windows simultaneously, will
these processes get distributed equally to all the available processors,
resulting in greater throughput? Maybe I should elaborate my problem. Here's
my situation.
I've an application consisting of a GUI, some activex dll, activex exe. I
notice my application is pushing the CPU to the limit and I thought of
putting in more processors to improve performance. However, I'm not too sure
whether adding more processors will help. If I were to use distributed
programming, it would mean I've to dissect my application which is quite
tedious. Hopefully by adding more processors, it will solve the problem.
"Klaus H. Probst" wrote in message
news:OSWFlOWjDHA.1672@TK2MSFTNGP09.phx.gbl...
> You can use an API called SetThreadAffinity to make the OS prefer one
> processor over the other one. But as Randy said, you're always limited to
> one thread so it doesn't help too much.
>
> In general this is something you don't do even if you're writing C++ and
> creating threads manually. Depending on what you're doing there are ways
to
> let the OS optimize thread timeslices across more than one CPU.
>
> My advise would be to not worry about that... Windows is smart enough to
> shift load around when it needs to.
>
> --
> ____________________
> Klaus H. Probst, MVP
> http://www.vbbox.com/
>
>
> Please post/reply to the newsgroup(s)
>
>
> "Chew" wrote in message
> news:bm0235$490$1@nobel2.pacific.net.sg...
> > Hi,
> >
> > I'm aware that Wink2k does support 2 or more processors. Will a program
> > developed using VB6 be able to take advantage of the additional
processing
> > power if I add more processors? Do I need to install any service pack
from
> > microsoft? Do I need to re-design and re-code my program?
> >
> > Thanks,
> > chew
> >
> >
>
>
-
Re: Taking Advantage of Additional Processors
Any comments are welcome. Thanks.
"Chew" wrote in message
news:bm0c1g$a27$1@nobel2.pacific.net.sg...
> If I've a number of processes running on the Windows simultaneously, will
> these processes get distributed equally to all the available processors,
> resulting in greater throughput? Maybe I should elaborate my problem.
Here's
> my situation.
>
> I've an application consisting of a GUI, some activex dll, activex exe. I
> notice my application is pushing the CPU to the limit and I thought of
> putting in more processors to improve performance. However, I'm not too
sure
> whether adding more processors will help. If I were to use distributed
> programming, it would mean I've to dissect my application which is quite
> tedious. Hopefully by adding more processors, it will solve the problem.
>
> "Klaus H. Probst" wrote in message
> news:OSWFlOWjDHA.1672@TK2MSFTNGP09.phx.gbl...
> > You can use an API called SetThreadAffinity to make the OS prefer one
> > processor over the other one. But as Randy said, you're always limited
to
> > one thread so it doesn't help too much.
> >
> > In general this is something you don't do even if you're writing C++ and
> > creating threads manually. Depending on what you're doing there are ways
> to
> > let the OS optimize thread timeslices across more than one CPU.
> >
> > My advise would be to not worry about that... Windows is smart enough to
> > shift load around when it needs to.
> >
> > --
> > ____________________
> > Klaus H. Probst, MVP
> > http://www.vbbox.com/
> >
> >
> > Please post/reply to the newsgroup(s)
> >
> >
> > "Chew" wrote in message
> > news:bm0235$490$1@nobel2.pacific.net.sg...
> > > Hi,
> > >
> > > I'm aware that Wink2k does support 2 or more processors. Will a
program
> > > developed using VB6 be able to take advantage of the additional
> processing
> > > power if I add more processors? Do I need to install any service pack
> from
> > > microsoft? Do I need to re-design and re-code my program?
> > >
> > > Thanks,
> > > chew
> > >
> > >
> >
> >
>
>
-
Re: Taking Advantage of Additional Processors
Your GUI application will have a single thread of execution Chew, and so
will only execute on one processor at a time. However, the O/S may move it
between the available processors if a different one looks to be less loaded,
e.g. if you find you're competing with another application on the current
processor.
The DLL is an integral part of your overall GUI process, and so cannot be
scheduled separately.
If you have multiple copies of your GUI application then the O/S will
automatically load-balance them between the available processors.
Your ActiveX EXE is a slightly different case. It's a separate process (i.e.
not an integral part of your GUI application), and so may be scheduled on a
different processor to the GUI application. Also, VB ActiveX EXEs *can* be
multi-threaded -- it all depends on how it was built. Did you write it
yourself, or is it a third-party component?
Tony Proctor
"Chew" wrote in message
news:bm0c1g$a27$1@nobel2.pacific.net.sg...
> If I've a number of processes running on the Windows simultaneously, will
> these processes get distributed equally to all the available processors,
> resulting in greater throughput? Maybe I should elaborate my problem.
Here's
> my situation.
>
> I've an application consisting of a GUI, some activex dll, activex exe. I
> notice my application is pushing the CPU to the limit and I thought of
> putting in more processors to improve performance. However, I'm not too
sure
> whether adding more processors will help. If I were to use distributed
> programming, it would mean I've to dissect my application which is quite
> tedious. Hopefully by adding more processors, it will solve the problem.
>
> "Klaus H. Probst" wrote in message
> news:OSWFlOWjDHA.1672@TK2MSFTNGP09.phx.gbl...
> > You can use an API called SetThreadAffinity to make the OS prefer one
> > processor over the other one. But as Randy said, you're always limited
to
> > one thread so it doesn't help too much.
> >
> > In general this is something you don't do even if you're writing C++ and
> > creating threads manually. Depending on what you're doing there are ways
> to
> > let the OS optimize thread timeslices across more than one CPU.
> >
> > My advise would be to not worry about that... Windows is smart enough to
> > shift load around when it needs to.
> >
> > --
> > ____________________
> > Klaus H. Probst, MVP
> > http://www.vbbox.com/
> >
> >
> > Please post/reply to the newsgroup(s)
> >
> >
> > "Chew" wrote in message
> > news:bm0235$490$1@nobel2.pacific.net.sg...
> > > Hi,
> > >
> > > I'm aware that Wink2k does support 2 or more processors. Will a
program
> > > developed using VB6 be able to take advantage of the additional
> processing
> > > power if I add more processors? Do I need to install any service pack
> from
> > > microsoft? Do I need to re-design and re-code my program?
> > >
> > > Thanks,
> > > chew
> > >
> > >
> >
> >
>
>
-
Re: Taking Advantage of Additional Processors
Thanks. I wrote the ActiveX exe myself. They are using Thread per object
model. In summary, am I right to say the Windows OS will *definitely*
utilise the additional processors if my application is multithreaded and
hence giving a greater throughput compare to a single processor machine?
"Tony Proctor" wrote in message
news:#BOxYtXjDHA.2732@TK2MSFTNGP11.phx.gbl...
> Your GUI application will have a single thread of execution Chew, and so
> will only execute on one processor at a time. However, the O/S may move it
> between the available processors if a different one looks to be less
loaded,
> e.g. if you find you're competing with another application on the current
> processor.
>
> The DLL is an integral part of your overall GUI process, and so cannot be
> scheduled separately.
>
> If you have multiple copies of your GUI application then the O/S will
> automatically load-balance them between the available processors.
>
> Your ActiveX EXE is a slightly different case. It's a separate process
(i.e.
> not an integral part of your GUI application), and so may be scheduled on
a
> different processor to the GUI application. Also, VB ActiveX EXEs *can* be
> multi-threaded -- it all depends on how it was built. Did you write it
> yourself, or is it a third-party component?
>
> Tony Proctor
>
> "Chew" wrote in message
> news:bm0c1g$a27$1@nobel2.pacific.net.sg...
> > If I've a number of processes running on the Windows simultaneously,
will
> > these processes get distributed equally to all the available processors,
> > resulting in greater throughput? Maybe I should elaborate my problem.
> Here's
> > my situation.
> >
> > I've an application consisting of a GUI, some activex dll, activex exe.
I
> > notice my application is pushing the CPU to the limit and I thought of
> > putting in more processors to improve performance. However, I'm not too
> sure
> > whether adding more processors will help. If I were to use distributed
> > programming, it would mean I've to dissect my application which is quite
> > tedious. Hopefully by adding more processors, it will solve the problem.
> >
> > "Klaus H. Probst" wrote in message
> > news:OSWFlOWjDHA.1672@TK2MSFTNGP09.phx.gbl...
> > > You can use an API called SetThreadAffinity to make the OS prefer one
> > > processor over the other one. But as Randy said, you're always limited
> to
> > > one thread so it doesn't help too much.
> > >
> > > In general this is something you don't do even if you're writing C++
and
> > > creating threads manually. Depending on what you're doing there are
ways
> > to
> > > let the OS optimize thread timeslices across more than one CPU.
> > >
> > > My advise would be to not worry about that... Windows is smart enough
to
> > > shift load around when it needs to.
> > >
> > > --
> > > ____________________
> > > Klaus H. Probst, MVP
> > > http://www.vbbox.com/
> > >
> > >
> > > Please post/reply to the newsgroup(s)
> > >
> > >
> > > "Chew" wrote in message
> > > news:bm0235$490$1@nobel2.pacific.net.sg...
> > > > Hi,
> > > >
> > > > I'm aware that Wink2k does support 2 or more processors. Will a
> program
> > > > developed using VB6 be able to take advantage of the additional
> > processing
> > > > power if I add more processors? Do I need to install any service
pack
> > from
> > > > microsoft? Do I need to re-design and re-code my program?
> > > >
> > > > Thanks,
> > > > chew
> > > >
> > > >
> > >
> > >
> >
> >
>
>
-
Re: Taking Advantage of Additional Processors
It will use them Chew. However, the level to which it uses them depends on
how many threads you're using, and how much work they're each doing. For
instance, if most of the work is done by your main GUI application, and only
a little done by the ActiveX EXE threads, then the utilisation will not be
evenly loaded.
Tony Proctor
"Chew" wrote in message
news:bm0kka$af$1@nobel.pacific.net.sg...
> Thanks. I wrote the ActiveX exe myself. They are using Thread per object
> model. In summary, am I right to say the Windows OS will *definitely*
> utilise the additional processors if my application is multithreaded and
> hence giving a greater throughput compare to a single processor machine?
>
> "Tony Proctor" wrote in message
> news:#BOxYtXjDHA.2732@TK2MSFTNGP11.phx.gbl...
> > Your GUI application will have a single thread of execution Chew, and so
> > will only execute on one processor at a time. However, the O/S may move
it
> > between the available processors if a different one looks to be less
> loaded,
> > e.g. if you find you're competing with another application on the
current
> > processor.
> >
> > The DLL is an integral part of your overall GUI process, and so cannot
be
> > scheduled separately.
> >
> > If you have multiple copies of your GUI application then the O/S will
> > automatically load-balance them between the available processors.
> >
> > Your ActiveX EXE is a slightly different case. It's a separate process
> (i.e.
> > not an integral part of your GUI application), and so may be scheduled
on
> a
> > different processor to the GUI application. Also, VB ActiveX EXEs *can*
be
> > multi-threaded -- it all depends on how it was built. Did you write it
> > yourself, or is it a third-party component?
> >
> > Tony Proctor
> >
> > "Chew" wrote in message
> > news:bm0c1g$a27$1@nobel2.pacific.net.sg...
> > > If I've a number of processes running on the Windows simultaneously,
> will
> > > these processes get distributed equally to all the available
processors,
> > > resulting in greater throughput? Maybe I should elaborate my problem.
> > Here's
> > > my situation.
> > >
> > > I've an application consisting of a GUI, some activex dll, activex
exe.
> I
> > > notice my application is pushing the CPU to the limit and I thought of
> > > putting in more processors to improve performance. However, I'm not
too
> > sure
> > > whether adding more processors will help. If I were to use distributed
> > > programming, it would mean I've to dissect my application which is
quite
> > > tedious. Hopefully by adding more processors, it will solve the
problem.
> > >
> > > "Klaus H. Probst" wrote in message
> > > news:OSWFlOWjDHA.1672@TK2MSFTNGP09.phx.gbl...
> > > > You can use an API called SetThreadAffinity to make the OS prefer
one
> > > > processor over the other one. But as Randy said, you're always
limited
> > to
> > > > one thread so it doesn't help too much.
> > > >
> > > > In general this is something you don't do even if you're writing C++
> and
> > > > creating threads manually. Depending on what you're doing there are
> ways
> > > to
> > > > let the OS optimize thread timeslices across more than one CPU.
> > > >
> > > > My advise would be to not worry about that... Windows is smart
enough
> to
> > > > shift load around when it needs to.
> > > >
> > > > --
> > > > ____________________
> > > > Klaus H. Probst, MVP
> > > > http://www.vbbox.com/
> > > >
> > > >
> > > > Please post/reply to the newsgroup(s)
> > > >
> > > >
> > > > "Chew" wrote in message
> > > > news:bm0235$490$1@nobel2.pacific.net.sg...
> > > > > Hi,
> > > > >
> > > > > I'm aware that Wink2k does support 2 or more processors. Will a
> > program
> > > > > developed using VB6 be able to take advantage of the additional
> > > processing
> > > > > power if I add more processors? Do I need to install any service
> pack
> > > from
> > > > > microsoft? Do I need to re-design and re-code my program?
> > > > >
> > > > > Thanks,
> > > > > chew
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
-
Re: Taking Advantage of Additional Processors
There are VB6 packages which allow it to multi thread.
Google is your friend.
After that, your design is critical.
Haven't met too many programmers who can take advantage / really exploit
threads.
Perhaps 1/100 ?
"Chew" wrote in message
news:bm0235$490$1@nobel2.pacific.net.sg...
> Hi,
>
> I'm aware that Wink2k does support 2 or more processors. Will a program
> developed using VB6 be able to take advantage of the additional processing
> power if I add more processors? Do I need to install any service pack from
> microsoft? Do I need to re-design and re-code my program?
>
> Thanks,
> chew
>
>
-
Re: Taking Advantage of Additional Processors
You are confusing "use of multiple processors" with "distribute usage across
all processors". The latter is what Windows does quite nicely, and which I
alluded to earlier. C++ apps can be designed to have specific portions use
specific processors, but this is a highly specialized requirement - perhaps
a high-end CAD app or math-crunching app would require this amount of
specialization. As Klaus said ... Windows handles distributing the total
load on the processors across all so none is maxed out. Typically, as I
stated, you'll see the taskman in a two-processor system running at 50% when
a VB app is maxing out. If 4 processors were in that box, you'd see 25%
each. Regardless of the number of processors, the app is still maxing at
100% ... the additional processors ensure your system doesn't lock when this
process is in process. Personally, after having a dual-processor workstation
for the past three years, I won't go back to a single. Not because I max out
my VB apps, but because this distribution of load applies to every app. I've
never had both processors maxed at 100% since I got this box, no matter what
I have running (and believe me, I normally have about 20 apps going at once
in order to respond to these groups).
--
Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.
"Chew" wrote in message
news:bm0kka$af$1@nobel.pacific.net.sg...
: Thanks. I wrote the ActiveX exe myself. They are using Thread per object
: model. In summary, am I right to say the Windows OS will *definitely*
: utilise the additional processors if my application is multithreaded and
: hence giving a greater throughput compare to a single processor machine?
:
: "Tony Proctor" wrote in message
: news:#BOxYtXjDHA.2732@TK2MSFTNGP11.phx.gbl...
: > Your GUI application will have a single thread of execution Chew, and so
: > will only execute on one processor at a time. However, the O/S may move
it
: > between the available processors if a different one looks to be less
: loaded,
: > e.g. if you find you're competing with another application on the
current
: > processor.
: >
: > The DLL is an integral part of your overall GUI process, and so cannot
be
: > scheduled separately.
: >
: > If you have multiple copies of your GUI application then the O/S will
: > automatically load-balance them between the available processors.
: >
: > Your ActiveX EXE is a slightly different case. It's a separate process
: (i.e.
: > not an integral part of your GUI application), and so may be scheduled
on
: a
: > different processor to the GUI application. Also, VB ActiveX EXEs *can*
be
: > multi-threaded -- it all depends on how it was built. Did you write it
: > yourself, or is it a third-party component?
: >
: > Tony Proctor
: >
: > "Chew" wrote in message
: > news:bm0c1g$a27$1@nobel2.pacific.net.sg...
: > > If I've a number of processes running on the Windows simultaneously,
: will
: > > these processes get distributed equally to all the available
processors,
: > > resulting in greater throughput? Maybe I should elaborate my problem.
: > Here's
: > > my situation.
: > >
: > > I've an application consisting of a GUI, some activex dll, activex
exe.
: I
: > > notice my application is pushing the CPU to the limit and I thought of
: > > putting in more processors to improve performance. However, I'm not
too
: > sure
: > > whether adding more processors will help. If I were to use distributed
: > > programming, it would mean I've to dissect my application which is
quite
: > > tedious. Hopefully by adding more processors, it will solve the
problem.
: > >
: > > "Klaus H. Probst" wrote in message
: > > news:OSWFlOWjDHA.1672@TK2MSFTNGP09.phx.gbl...
: > > > You can use an API called SetThreadAffinity to make the OS prefer
one
: > > > processor over the other one. But as Randy said, you're always
limited
: > to
: > > > one thread so it doesn't help too much.
: > > >
: > > > In general this is something you don't do even if you're writing C++
: and
: > > > creating threads manually. Depending on what you're doing there are
: ways
: > > to
: > > > let the OS optimize thread timeslices across more than one CPU.
: > > >
: > > > My advise would be to not worry about that... Windows is smart
enough
: to
: > > > shift load around when it needs to.
: > > >
: > > > --
: > > > ____________________
: > > > Klaus H. Probst, MVP
: > > > http://www.vbbox.com/
: > > >
: > > >
: > > > Please post/reply to the newsgroup(s)
: > > >
: > > >
: > > > "Chew" wrote in message
: > > > news:bm0235$490$1@nobel2.pacific.net.sg...
: > > > > Hi,
: > > > >
: > > > > I'm aware that Wink2k does support 2 or more processors. Will a
: > program
: > > > > developed using VB6 be able to take advantage of the additional
: > > processing
: > > > > power if I add more processors? Do I need to install any service
: pack
: > > from
: > > > > microsoft? Do I need to re-design and re-code my program?
: > > > >
: > > > > Thanks,
: > > > > chew
: > > > >
: > > > >
: > > >
: > > >
: > >
: > >
: >
: >
:
:
-
Re: Taking Advantage of Additional Processors
Hi Randy,
I agree that the VB app will still max at 100% regardless of the no of
processors. I supposed the "VB app" is single threaded. I would like ask the
same question again which I posted earlier. Do you see any gain in the
amount of work done if I've an application consisting of a number of
processes running on a multiple processors machine than on a single
processor machine?
Chew
"Randy Birch" wrote in message
news:OimDW7ejDHA.2416@TK2MSFTNGP10.phx.gbl...
> You are confusing "use of multiple processors" with "distribute usage
across
> all processors". The latter is what Windows does quite nicely, and which I
> alluded to earlier. C++ apps can be designed to have specific portions use
> specific processors, but this is a highly specialized requirement -
perhaps
> a high-end CAD app or math-crunching app would require this amount of
> specialization. As Klaus said ... Windows handles distributing the total
> load on the processors across all so none is maxed out. Typically, as I
> stated, you'll see the taskman in a two-processor system running at 50%
when
> a VB app is maxing out. If 4 processors were in that box, you'd see 25%
> each. Regardless of the number of processors, the app is still maxing at
> 100% ... the additional processors ensure your system doesn't lock when
this
> process is in process. Personally, after having a dual-processor
workstation
> for the past three years, I won't go back to a single. Not because I max
out
> my VB apps, but because this distribution of load applies to every app.
I've
> never had both processors maxed at 100% since I got this box, no matter
what
> I have running (and believe me, I normally have about 20 apps going at
once
> in order to respond to these groups).
>
> --
>
> Randy Birch
> MVP Visual Basic
> http://www.mvps.org/vbnet/
> Please respond only to the newsgroups so all can benefit.
>
>
> "Chew" wrote in message
> news:bm0kka$af$1@nobel.pacific.net.sg...
> : Thanks. I wrote the ActiveX exe myself. They are using Thread per object
> : model. In summary, am I right to say the Windows OS will *definitely*
> : utilise the additional processors if my application is multithreaded and
> : hence giving a greater throughput compare to a single processor machine?
> :
> : "Tony Proctor" wrote in message
> : news:#BOxYtXjDHA.2732@TK2MSFTNGP11.phx.gbl...
> : > Your GUI application will have a single thread of execution Chew, and
so
> : > will only execute on one processor at a time. However, the O/S may
move
> it
> : > between the available processors if a different one looks to be less
> : loaded,
> : > e.g. if you find you're competing with another application on the
> current
> : > processor.
> : >
> : > The DLL is an integral part of your overall GUI process, and so cannot
> be
> : > scheduled separately.
> : >
> : > If you have multiple copies of your GUI application then the O/S will
> : > automatically load-balance them between the available processors.
> : >
> : > Your ActiveX EXE is a slightly different case. It's a separate process
> : (i.e.
> : > not an integral part of your GUI application), and so may be scheduled
> on
> : a
> : > different processor to the GUI application. Also, VB ActiveX EXEs
*can*
> be
> : > multi-threaded -- it all depends on how it was built. Did you write it
> : > yourself, or is it a third-party component?
> : >
> : > Tony Proctor
> : >
> : > "Chew" wrote in message
> : > news:bm0c1g$a27$1@nobel2.pacific.net.sg...
> : > > If I've a number of processes running on the Windows simultaneously,
> : will
> : > > these processes get distributed equally to all the available
> processors,
> : > > resulting in greater throughput? Maybe I should elaborate my
problem.
> : > Here's
> : > > my situation.
> : > >
> : > > I've an application consisting of a GUI, some activex dll, activex
> exe.
> : I
> : > > notice my application is pushing the CPU to the limit and I thought
of
> : > > putting in more processors to improve performance. However, I'm not
> too
> : > sure
> : > > whether adding more processors will help. If I were to use
distributed
> : > > programming, it would mean I've to dissect my application which is
> quite
> : > > tedious. Hopefully by adding more processors, it will solve the
> problem.
> : > >
> : > > "Klaus H. Probst" wrote in message
> : > > news:OSWFlOWjDHA.1672@TK2MSFTNGP09.phx.gbl...
> : > > > You can use an API called SetThreadAffinity to make the OS prefer
> one
> : > > > processor over the other one. But as Randy said, you're always
> limited
> : > to
> : > > > one thread so it doesn't help too much.
> : > > >
> : > > > In general this is something you don't do even if you're writing
C++
> : and
> : > > > creating threads manually. Depending on what you're doing there
are
> : ways
> : > > to
> : > > > let the OS optimize thread timeslices across more than one CPU.
> : > > >
> : > > > My advise would be to not worry about that... Windows is smart
> enough
> : to
> : > > > shift load around when it needs to.
> : > > >
> : > > > --
> : > > > ____________________
> : > > > Klaus H. Probst, MVP
> : > > > http://www.vbbox.com/
> : > > >
> : > > >
> : > > > Please post/reply to the newsgroup(s)
> : > > >
> : > > >
> : > > > "Chew" wrote in message
> : > > > news:bm0235$490$1@nobel2.pacific.net.sg...
> : > > > > Hi,
> : > > > >
> : > > > > I'm aware that Wink2k does support 2 or more processors. Will a
> : > program
> : > > > > developed using VB6 be able to take advantage of the additional
> : > > processing
> : > > > > power if I add more processors? Do I need to install any service
> : pack
> : > > from
> : > > > > microsoft? Do I need to re-design and re-code my program?
> : > > > >
> : > > > > Thanks,
> : > > > > chew
> : > > > >
> : > > > >
> : > > >
> : > > >
> : > >
> : > >
> : >
> : >
> :
> :
>
>
-
Re: Taking Advantage of Additional Processors
Amount of work done if the product is a VB app itself .. no, no increase. If
you're using activex.exe's for some threads to spawn different processes, I
suspect you might, but only because there is free processor time available.
--
Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.
"Chew" wrote in message
news:bm2jkk$kan$1@nobel2.pacific.net.sg...
: Hi Randy,
:
: I agree that the VB app will still max at 100% regardless of the no of
: processors. I supposed the "VB app" is single threaded. I would like ask
the
: same question again which I posted earlier. Do you see any gain in the
: amount of work done if I've an application consisting of a number of
: processes running on a multiple processors machine than on a single
: processor machine?
:
: Chew
:
: "Randy Birch" wrote in message
: news:OimDW7ejDHA.2416@TK2MSFTNGP10.phx.gbl...
: > You are confusing "use of multiple processors" with "distribute usage
: across
: > all processors". The latter is what Windows does quite nicely, and which
I
: > alluded to earlier. C++ apps can be designed to have specific portions
use
: > specific processors, but this is a highly specialized requirement -
: perhaps
: > a high-end CAD app or math-crunching app would require this amount of
: > specialization. As Klaus said ... Windows handles distributing the total
: > load on the processors across all so none is maxed out. Typically, as I
: > stated, you'll see the taskman in a two-processor system running at 50%
: when
: > a VB app is maxing out. If 4 processors were in that box, you'd see 25%
: > each. Regardless of the number of processors, the app is still maxing at
: > 100% ... the additional processors ensure your system doesn't lock when
: this
: > process is in process. Personally, after having a dual-processor
: workstation
: > for the past three years, I won't go back to a single. Not because I max
: out
: > my VB apps, but because this distribution of load applies to every app.
: I've
: > never had both processors maxed at 100% since I got this box, no matter
: what
: > I have running (and believe me, I normally have about 20 apps going at
: once
: > in order to respond to these groups).
: >
: > --
: >
: > Randy Birch
: > MVP Visual Basic
: > http://www.mvps.org/vbnet/
: > Please respond only to the newsgroups so all can benefit.
: >
: >
: > "Chew" wrote in message
: > news:bm0kka$af$1@nobel.pacific.net.sg...
: > : Thanks. I wrote the ActiveX exe myself. They are using Thread per
object
: > : model. In summary, am I right to say the Windows OS will *definitely*
: > : utilise the additional processors if my application is multithreaded
and
: > : hence giving a greater throughput compare to a single processor
machine?
: > :
: > : "Tony Proctor" wrote in
message
: > : news:#BOxYtXjDHA.2732@TK2MSFTNGP11.phx.gbl...
: > : > Your GUI application will have a single thread of execution Chew,
and
: so
: > : > will only execute on one processor at a time. However, the O/S may
: move
: > it
: > : > between the available processors if a different one looks to be less
: > : loaded,
: > : > e.g. if you find you're competing with another application on the
: > current
: > : > processor.
: > : >
: > : > The DLL is an integral part of your overall GUI process, and so
cannot
: > be
: > : > scheduled separately.
: > : >
: > : > If you have multiple copies of your GUI application then the O/S
will
: > : > automatically load-balance them between the available processors.
: > : >
: > : > Your ActiveX EXE is a slightly different case. It's a separate
process
: > : (i.e.
: > : > not an integral part of your GUI application), and so may be
scheduled
: > on
: > : a
: > : > different processor to the GUI application. Also, VB ActiveX EXEs
: *can*
: > be
: > : > multi-threaded -- it all depends on how it was built. Did you write
it
: > : > yourself, or is it a third-party component?
: > : >
: > : > Tony Proctor
: > : >
: > : > "Chew" wrote in message
: > : > news:bm0c1g$a27$1@nobel2.pacific.net.sg...
: > : > > If I've a number of processes running on the Windows
simultaneously,
: > : will
: > : > > these processes get distributed equally to all the available
: > processors,
: > : > > resulting in greater throughput? Maybe I should elaborate my
: problem.
: > : > Here's
: > : > > my situation.
: > : > >
: > : > > I've an application consisting of a GUI, some activex dll, activex
: > exe.
: > : I
: > : > > notice my application is pushing the CPU to the limit and I
thought
: of
: > : > > putting in more processors to improve performance. However, I'm
not
: > too
: > : > sure
: > : > > whether adding more processors will help. If I were to use
: distributed
: > : > > programming, it would mean I've to dissect my application which is
: > quite
: > : > > tedious. Hopefully by adding more processors, it will solve the
: > problem.
: > : > >
: > : > > "Klaus H. Probst" wrote in message
: > : > > news:OSWFlOWjDHA.1672@TK2MSFTNGP09.phx.gbl...
: > : > > > You can use an API called SetThreadAffinity to make the OS
prefer
: > one
: > : > > > processor over the other one. But as Randy said, you're always
: > limited
: > : > to
: > : > > > one thread so it doesn't help too much.
: > : > > >
: > : > > > In general this is something you don't do even if you're writing
: C++
: > : and
: > : > > > creating threads manually. Depending on what you're doing there
: are
: > : ways
: > : > > to
: > : > > > let the OS optimize thread timeslices across more than one CPU.
: > : > > >
: > : > > > My advise would be to not worry about that... Windows is smart
: > enough
: > : to
: > : > > > shift load around when it needs to.
: > : > > >
: > : > > > --
: > : > > > ____________________
: > : > > > Klaus H. Probst, MVP
: > : > > > http://www.vbbox.com/
: > : > > >
: > : > > >
: > : > > > Please post/reply to the newsgroup(s)
: > : > > >
: > : > > >
: > : > > > "Chew" wrote in message
: > : > > > news:bm0235$490$1@nobel2.pacific.net.sg...
: > : > > > > Hi,
: > : > > > >
: > : > > > > I'm aware that Wink2k does support 2 or more processors. Will
a
: > : > program
: > : > > > > developed using VB6 be able to take advantage of the
additional
: > : > > processing
: > : > > > > power if I add more processors? Do I need to install any
service
: > : pack
: > : > > from
: > : > > > > microsoft? Do I need to re-design and re-code my program?
: > : > > > >
: > : > > > > Thanks,
: > : > > > > chew
: > : > > > >
: > : > > > >
: > : > > >
: > : > > >
: > : > >
: > : > >
: > : >
: > : >
: > :
: > :
: >
: >
:
:
-
Re: Taking Advantage of Additional Processors
Hi Randy,
My VB application will spawn 5 or 6 processes and all these processes are
ActiveX exe. I'll have to be very careful whether I can adopt a multiple
processors solution to get more work done. Don't want to get my ass kicked
by my boss.
chew
"Randy Birch" wrote in message
news:efS0MqhjDHA.2432@TK2MSFTNGP10.phx.gbl...
> Amount of work done if the product is a VB app itself .. no, no increase.
If
> you're using activex.exe's for some threads to spawn different processes,
I
> suspect you might, but only because there is free processor time
available.
>
> --
>
> Randy Birch
> MVP Visual Basic
> http://www.mvps.org/vbnet/
> Please respond only to the newsgroups so all can benefit.
>
>
> "Chew" wrote in message
> news:bm2jkk$kan$1@nobel2.pacific.net.sg...
> : Hi Randy,
> :
> : I agree that the VB app will still max at 100% regardless of the no of
> : processors. I supposed the "VB app" is single threaded. I would like ask
> the
> : same question again which I posted earlier. Do you see any gain in the
> : amount of work done if I've an application consisting of a number of
> : processes running on a multiple processors machine than on a single
> : processor machine?
> :
> : Chew
> :
> : "Randy Birch" wrote in message
> : news:OimDW7ejDHA.2416@TK2MSFTNGP10.phx.gbl...
> : > You are confusing "use of multiple processors" with "distribute usage
> : across
> : > all processors". The latter is what Windows does quite nicely, and
which
> I
> : > alluded to earlier. C++ apps can be designed to have specific portions
> use
> : > specific processors, but this is a highly specialized requirement -
> : perhaps
> : > a high-end CAD app or math-crunching app would require this amount of
> : > specialization. As Klaus said ... Windows handles distributing the
total
> : > load on the processors across all so none is maxed out. Typically, as
I
> : > stated, you'll see the taskman in a two-processor system running at
50%
> : when
> : > a VB app is maxing out. If 4 processors were in that box, you'd see
25%
> : > each. Regardless of the number of processors, the app is still maxing
at
> : > 100% ... the additional processors ensure your system doesn't lock
when
> : this
> : > process is in process. Personally, after having a dual-processor
> : workstation
> : > for the past three years, I won't go back to a single. Not because I
max
> : out
> : > my VB apps, but because this distribution of load applies to every
app.
> : I've
> : > never had both processors maxed at 100% since I got this box, no
matter
> : what
> : > I have running (and believe me, I normally have about 20 apps going at
> : once
> : > in order to respond to these groups).
> : >
> : > --
> : >
> : > Randy Birch
> : > MVP Visual Basic
> : > http://www.mvps.org/vbnet/
> : > Please respond only to the newsgroups so all can benefit.
> : >
> : >
> : > "Chew" wrote in message
> : > news:bm0kka$af$1@nobel.pacific.net.sg...
> : > : Thanks. I wrote the ActiveX exe myself. They are using Thread per
> object
> : > : model. In summary, am I right to say the Windows OS will
*definitely*
> : > : utilise the additional processors if my application is multithreaded
> and
> : > : hence giving a greater throughput compare to a single processor
> machine?
> : > :
> : > : "Tony Proctor" wrote in
> message
> : > : news:#BOxYtXjDHA.2732@TK2MSFTNGP11.phx.gbl...
> : > : > Your GUI application will have a single thread of execution Chew,
> and
> : so
> : > : > will only execute on one processor at a time. However, the O/S may
> : move
> : > it
> : > : > between the available processors if a different one looks to be
less
> : > : loaded,
> : > : > e.g. if you find you're competing with another application on the
> : > current
> : > : > processor.
> : > : >
> : > : > The DLL is an integral part of your overall GUI process, and so
> cannot
> : > be
> : > : > scheduled separately.
> : > : >
> : > : > If you have multiple copies of your GUI application then the O/S
> will
> : > : > automatically load-balance them between the available processors.
> : > : >
> : > : > Your ActiveX EXE is a slightly different case. It's a separate
> process
> : > : (i.e.
> : > : > not an integral part of your GUI application), and so may be
> scheduled
> : > on
> : > : a
> : > : > different processor to the GUI application. Also, VB ActiveX EXEs
> : *can*
> : > be
> : > : > multi-threaded -- it all depends on how it was built. Did you
write
> it
> : > : > yourself, or is it a third-party component?
> : > : >
> : > : > Tony Proctor
> : > : >
> : > : > "Chew" wrote in message
> : > : > news:bm0c1g$a27$1@nobel2.pacific.net.sg...
> : > : > > If I've a number of processes running on the Windows
> simultaneously,
> : > : will
> : > : > > these processes get distributed equally to all the available
> : > processors,
> : > : > > resulting in greater throughput? Maybe I should elaborate my
> : problem.
> : > : > Here's
> : > : > > my situation.
> : > : > >
> : > : > > I've an application consisting of a GUI, some activex dll,
activex
> : > exe.
> : > : I
> : > : > > notice my application is pushing the CPU to the limit and I
> thought
> : of
> : > : > > putting in more processors to improve performance. However, I'm
> not
> : > too
> : > : > sure
> : > : > > whether adding more processors will help. If I were to use
> : distributed
> : > : > > programming, it would mean I've to dissect my application which
is
> : > quite
> : > : > > tedious. Hopefully by adding more processors, it will solve the
> : > problem.
> : > : > >
> : > : > > "Klaus H. Probst" wrote in message
> : > : > > news:OSWFlOWjDHA.1672@TK2MSFTNGP09.phx.gbl...
> : > : > > > You can use an API called SetThreadAffinity to make the OS
> prefer
> : > one
> : > : > > > processor over the other one. But as Randy said, you're always
> : > limited
> : > : > to
> : > : > > > one thread so it doesn't help too much.
> : > : > > >
> : > : > > > In general this is something you don't do even if you're
writing
> : C++
> : > : and
> : > : > > > creating threads manually. Depending on what you're doing
there
> : are
> : > : ways
> : > : > > to
> : > : > > > let the OS optimize thread timeslices across more than one
CPU.
> : > : > > >
> : > : > > > My advise would be to not worry about that... Windows is smart
> : > enough
> : > : to
> : > : > > > shift load around when it needs to.
> : > : > > >
> : > : > > > --
> : > : > > > ____________________
> : > : > > > Klaus H. Probst, MVP
> : > : > > > http://www.vbbox.com/
> : > : > > >
> : > : > > >
> : > : > > > Please post/reply to the newsgroup(s)
> : > : > > >
> : > : > > >
> : > : > > > "Chew" wrote in message
> : > : > > > news:bm0235$490$1@nobel2.pacific.net.sg...
> : > : > > > > Hi,
> : > : > > > >
> : > : > > > > I'm aware that Wink2k does support 2 or more processors.
Will
> a
> : > : > program
> : > : > > > > developed using VB6 be able to take advantage of the
> additional
> : > : > > processing
> : > : > > > > power if I add more processors? Do I need to install any
> service
> : > : pack
> : > : > > from
> : > : > > > > microsoft? Do I need to re-design and re-code my program?
> : > : > > > >
> : > : > > > > Thanks,
> : > : > > > > chew
> : > : > > > >
> : > : > > > >
> : > : > > >
> : > : > > >
> : > : > >
> : > : > >
> : > : >
> : > : >
> : > :
> : > :
> : >
> : >
> :
> :
>
>
-
Re: Taking Advantage of Additional Processors
> My VB application will spawn 5 or 6 processes
The simple answer is yes. You will see a speed up. But not
OrigTime/NoOfProcessors.
Why not use DCOM to start some of your processes on another machine? This
could be cost effective depending on how much work the activeX exes do
(bigger workload = more effective). If using DCOM think where your data
resides. which machine/csv/database/memory etc.
Cheers
Stu