Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

The problem is that you insist upon taking a specific subject--on-topic in context of both the site and the thread--and injecting a generalised statement, based more upon prejudice and dogma, than reasoned argument, and stating your position in those terms.

It does nothing to further the original discussion and serves only to provide a platform on which you can expound in the sure knowledge that your pro-unix, "windows is broken" stance will play to the gallery.

An example;

...the key semantic that makes fork() so useful is that it allows inheriting the current execution environment to the child.

This is a circular argument. With threads, you don't need to "inherit the current execution environment"--you already have it! Each thread is a complete execution enviroment. It can choose to be completely isolated and independant, or share exactly that which needs to be shared.

The primary flaw in perl threads is that they attempt to emulate the fork mechanism in order to make fork & exec style idioms portable to the windows platform. The very thing that makes iThreads accusable of being "slow and memory hungry" is the that they insist upon attempting to duplicate the fork behaviour by replicating everything that exists at the point of spawn.

Indeed, from my less than perfect historical view, this exactly how they came about. It's not that there is anything wrong with the fork behaviour where that is the "natural order of things"--it just doesn't work well where the OS does not support it natively. Laudible though portability is, it will always be a compromise.

And it is unnecessary. If each thread was simply a clean, separate interpeter running in it's own thread in isolation of the others; with no "default" replication of anything; with only that which the programmer chose to share being shared; all of the problems would be completely negated.

In this schema, shared data (and even objects) would exist in a single (hidden) thread. Accessing those shared entities from other threads would be transparent (via queued requests hidden behind tie's) from the user thread to the sharing thread. The tie/shared mechanism would perform all of the synchronisation and locking. The programmer would simple declare the shared entities as shared and use them, and everything else would be transparent.

But that has as much relevance to anyone needing multitasking with bidirectional communications today as "slightly better IPC mechanisms than those invented decades ago"--none!


Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.

In reply to Re^7: Isolating dynamically loaded modules with Thread::Isolate. by BrowserUk
in thread Isolating dynamically loaded modules with Thread::Isolate. by gmpassos

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 romping around the Monastery: (7)
As of 2024-03-28 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found