multicore cpu

Q

QoS

It seems my programs writtin in Perl only see one core on a dual core cpu.

Evertime the software has a lot of work to do the cpu utilization goes
up to exactly 50%. Is there something wrong with my Perl installation?
 
S

smallpond

It seems my programs writtin in Perl only see one core on a dual core cpu..

Evertime the software has a lot of work to do the cpu utilization goes
up to exactly 50%.  Is there something wrong with my Perl installation?

How many threads are you launching?
 
Q

QoS

Sherm Pendley said:
Are you *asking* Perl to use the additional cores, by writing multi-threaded
code? There's been some talk of auto-threading in Perl 6, but that's not
soup yet; in the current release you have to do it yourself.

sherm--

Thank you for your replies,

Yes this particular program does utilize threads and threads::shared.

When the main code signals the worker thread to decode some large files
by setting a shared variable, the worker performs enough work to bring
cpu usage up to 50%, so it doesnt seem to utilize the additional core.

Reading up on the threads docs, it seems there is no way to explicitly
assign an affinity to a particular thread when it is launched.

I am thinking perhaps my Perl installtion might have been installed
incorrectly for utilizing multi-core cpu's?

C:\Documents and Settings\Admin>perl -v

This is perl, v5.8.8 built for MSWin32-x86-multi-thread
Binary build 822 [280952] provided by ActiveState http://www.ActiveState.com
Built Jul 31 2007 19:34:48

C:\Documents and Settings\Admin>ver

Microsoft Windows XP [Version 5.1.2600]

Thanks,
Jason
 
S

sln

Sherm Pendley said:
Are you *asking* Perl to use the additional cores, by writing multi-threaded
code? There's been some talk of auto-threading in Perl 6, but that's not
soup yet; in the current release you have to do it yourself.

sherm--

Thank you for your replies,

Yes this particular program does utilize threads and threads::shared.

When the main code signals the worker thread to decode some large files
by setting a shared variable, the worker performs enough work to bring
cpu usage up to 50%, so it doesnt seem to utilize the additional core.

Reading up on the threads docs, it seems there is no way to explicitly
assign an affinity to a particular thread when it is launched.

I am thinking perhaps my Perl installtion might have been installed
incorrectly for utilizing multi-core cpu's?

C:\Documents and Settings\Admin>perl -v

This is perl, v5.8.8 built for MSWin32-x86-multi-thread
Binary build 822 [280952] provided by ActiveState http://www.ActiveState.com
Built Jul 31 2007 19:34:48

C:\Documents and Settings\Admin>ver

Microsoft Windows XP [Version 5.1.2600]

Thanks,
Jason
Looks like Microsoft OS. There is no guarantee of dual-core usage on multiple
threads. The first level is multiple-processes, still no guarantee.
Read up in Visual C docs on affinity programming.

My bet is that Perl lacks parameters inducing the default processor only,
no matter what.

-sln
 
X

Xho Jingleheimerschmidt

Thank you for your replies,

Yes this particular program does utilize threads and threads::shared.

When the main code signals the worker thread to decode some large files
by setting a shared variable, the worker performs enough work to bring
cpu usage up to 50%, so it doesnt seem to utilize the additional core.

You start *one* worker thread. It uses *one* CPU.

What is the point of having one worker thread? If there is only to be
one, why not just have the main thread do the work itself?
Reading up on the threads docs, it seems there is no way to explicitly
assign an affinity to a particular thread when it is launched.

An affinity for what?

Xho
 
S

sln

[snip]
An affinity for what?

Xho

In Microsoft OS you can asign an affinity (the tendency to use) when you start
a process, or can be assigned via the registry, set from explorer shell, proxied
on your behalf, to use a particular core or single core, in a dual/quad-core
environment.

-sln
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top