Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

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

This doesn't sound like a Win32 problem.

Perl isn't thread safe. Perl expects each interpretter and all of its bits to only be run by one thread. And each thread gets its own memory pool. For efficiency, which memory pool to use is determined by what the current thread is. Something is using the wrong pool or creating Perl data items in one thread and then using them in another.

Clone::clone() is written in XS and XS so very often makes something that is much, much more fragile than something written in plain Perl. It appears that Clone::clone() has no use for the extreme measure of using XS other than "speed!".

Storable::dclone() is also written in XS but appears to have taken extra steps to handle Perl threads.

So the speed difference you are seeing (which you didn't bother to describe at all which leads me to guess "not much") may just be the cost of handling threads correctly.

Compare Storable.xs to Clone.xs and you might be able to improve Clone to handle threads and then re-run your benchmarks.

Since using Storable::dclone() works, it would appear that Apache2 knows how to compartmentalize Perl interpretters to just one thread each. So it might also work to tweak how Apache2 is built to tell the embedded Perl code that it doesn't care about threads. I wouldn't be too surprised to find that the Apache group hadn't considered using no-threads Perl in a multi-threaded environment. But doing so might cause Clone::clone() to work and might also make the embedded perls run just a bit faster to boot.

- tye        


In reply to Re: Class::DBI explodes on mod_perl/Win32 due to Clone (!Win32) by tye
in thread Class::DBI explodes on mod_perl/Win32 due to Clone by fenLisesi

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 rifling through the Monastery: (5)
As of 2024-04-23 22:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found