Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
.... regardless of BrowserUk's belief that threads, especially Perl threads, will give you some sort of performance boost ..... try it yourself and see, .....huge overheads

....maybe they do in MSWindows....but not under linux...and frankly, i would not use an OS that let a process running on one core of a multi-core system, alter the goings on in a neighboring core..... that is what you seem to be suggesting...... i could start a perl script, start x number of threads, and be assured that each thread (code block) will be assigned to a separate core..... with cross-core variable sharing thru threads::shared? .....bad design......

on linux, each thread of a spawned thread set shares the same pid, and if you call exit from any thread, it takes down all threads under the master thread, including the master thread.... what more evidence do you need that they share the same pid?... and probably have their nice level set as a whole based on the master thread's pid

...so even though in theory, BrowserUk's assertion that Perl threads will give you concurrent processing... in all likelihood, they won't..... i would bet for security, a pid gets spawned into 1 core, and since threads on linux share the same master pid, all threads probably will be assigned to the same core.... otherwise it would be chaos as programs try to spawn threads into other cores..... maybe it is done in sloppy OS's ?..... but not to abandon the intent of my reply..... threads are good if you want easy realtime sharing of data between threads..... but they are not for speed

...what you want to look at is forking and using shared memory segments for the best speed.... read "perldoc perlipc" and look for the section SysV IPC.... it is the fastest

.... and that is no baloney...i'm a vegetarian ;-)


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku

In reply to Re: Standard way to convert timezone in multithreaded script by zentara
in thread Standard way to convert timezone in multithreaded script by whale2

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-24 12:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found