multicore cpu

Discussion in 'Perl Misc' started by QoS@invalid.net, Apr 11, 2009.

  1. Guest

    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?
     
    , Apr 11, 2009
    #1
    1. Advertising

  2. smallpond Guest

    On Apr 11, 10:40 am, wrote:
    > 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?
     
    smallpond, Apr 11, 2009
    #2
    1. Advertising

  3. Guest

    Sherm Pendley <> wrote in message-id: <>

    >
    > writes:
    >
    > > 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?

    >
    > 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
     
    , Apr 12, 2009
    #3
  4. Guest

    On Sun, 12 Apr 2009 14:42:39 GMT, wrote:

    >
    >Sherm Pendley <> wrote in message-id: <>
    >
    >>
    >> writes:
    >>
    >> > 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?

    >>
    >> 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
     
    , Apr 12, 2009
    #4
  5. wrote:
    > Sherm Pendley <> wrote in message-id: <>
    >
    >> writes:
    >>
    >>> 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?

    >> 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.


    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
     
    Xho Jingleheimerschmidt, Apr 12, 2009
    #5
  6. Guest

    On Sun, 12 Apr 2009 12:28:54 -0700, Xho Jingleheimerschmidt <> wrote:

    [snip]
    >>
    >> 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


    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
     
    , Apr 12, 2009
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dimitri Ognibene

    java vm and multicore

    Dimitri Ognibene, Apr 27, 2006, in forum: Java
    Replies:
    1
    Views:
    504
    Daniel Dyer
    Apr 27, 2006
  2. Neo
    Replies:
    4
    Views:
    371
    Joe Seigh
    Jan 31, 2008
  3. finecur
    Replies:
    12
    Views:
    1,230
    Juha Nieminen
    Feb 3, 2008
  4. Gernot Frisch
    Replies:
    1
    Views:
    328
    Mirco Wahab
    Jul 23, 2008
  5. John Nagle
    Replies:
    19
    Views:
    2,635
    Ryan Kelly
    Feb 21, 2010
Loading...

Share This Page