|
Posted by smallpond on February 25, 2008, 12:23 pm
Please log in for more thread options > The machine is a single processor/quad core server running the latest
> Windows Server.
>
> The Perl we're using is the 64 bit build of 5.8.8 from Activestate.
>
> I created a script that uses threads to launch a series of standalone
> SQL scripts (I use system to invoke mysql to run my SQL scripts). I
> had thought that system was spawning child processes, but it seems
> that the script that launches them waits on each child before
> launching the next. It is looking like the threads launches all
> without wating for the next, which is closer to what I want.
>
> However, regardless of what I have tried so far, all the hard work is
> being done by one core, with the other three mostly sitting idle.
>
> What can I do to distribute the workload evenly over all the cores in
> the machine? The whole purpose of this machine was to serve as a
> compute server for my colleagues and I, and in fact only two of us
> have a need to access it, and this is so we can run heavy duty DB
> analysis programs on it. The code works adequately, but it seems a
> shame to have invested in a quad core processor based machine only to
> have all the work done on only one core. I don't care if I have to
> launch threads or child processes, as long as I can distribute the
> work more evenly. Is what I am after possible?
>
> Thanks
>
> Ted
>
> BTW: are there any 64 bit modules on CPAN? The repository for the 64
> bit build that Activestate has provided seems to be empty.
See perlthrtut and check your perl build with: perl -V
Look for a line like:
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
I believe that the last part indicates whether perl tries to use
multiple
CPUs.
|