a) If I use an smp system on Linux, can I expect threads to run on different processors like kernel threads?
Assuming your Linux is using the right threading kernel/library, yes. ithreads is based on pthreads on most POSIX-like systems. Assuming the provided pthreads implementation is SMP capable, ithreads will be as well.

How exactly is the determination made which processor which thread runs on?
Thats a pthreads/OS kernel issue. I believe some platforms provide APIs to bind individual threads to run on specific CPUs, but I don't know that they're widely implemented.

One note about your app: 30 + 30 threads may appear to consume a lot of vmem on Linux (and Windows too). Consider tuning the default thread stack size to a small value (see Re: Use more threads. and the threads CPAN note).


Perl Contrarian & SQL fanboy

In reply to Re: multi-threaded questions by renodino
in thread multi-threaded questions by btoovey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.