Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: How do I get a unique Perl Interpreter ID?

by zwon (Abbot)
on Dec 01, 2011 at 15:29 UTC ( [id://941091]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How do I get a unique Perl Interpreter ID?
in thread How do I get a unique Perl Interpreter ID?

clone operation has almost nothing left to do beyond creating a bunch of entries in a page table with copy-on-write tags, it's not hard to imagine it eventually being possible for multiple interpreters to get cloned in the same microsecond.

Have you tried to actually timing it? Only kernel have access to the page table, and even if perl could mark pages as copy-on-write it wouldn't help, as it has to change addresses, so no COW when cloning interpreters. Perl has to duly copy all data from the original interpreter to the new one, and the more modules loaded the more data it has to copy, the more time it takes.

  • Comment on Re^3: How do I get a unique Perl Interpreter ID?

Replies are listed 'Best First'.
Re^4: How do I get a unique Perl Interpreter ID?
by wrog (Friar) on Dec 02, 2011 at 09:02 UTC

    Actually, now that I think about it some more, the real issue here is that once you have concurrency, you can just as easily have cloning happening in parallel, at which point, it doesn't actually matter how long it takes to perform a single thread-clone.

    That is, as long as there is the possibility that two cloning operations in parallel threads can finish at the same time, we're toast if we're depending solely on the clock to distinguish the resulting interpreters.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://941091]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-23 12:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found