perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Hay <steve....@uk.radan.com>
Subject Re: plans for mp2.0.0 release schedule
Date Thu, 02 Dec 2004 10:56:21 GMT
Stas Bekman wrote:

>There are a few issues left, which are hopefully will be resolved shortly. 
>
I have one big issue with porting my code to mp2 which I'm not sure if 
there's a resolution to?

I'm currently running mp1 on Win32.  The Perl interpreter used by mp1 on 
Win32 is single-threaded, which causes a bottleneck for busy sites 
because the Apache child threads serving responses have to fight over 
access to the single Perl thread available.  However, we've found that 
it works perfectly well in practice on small intranet sites, and this is 
what we're using it for.

If I switch to mp2 then the Perl interpreter is now multi-threaded, thus 
removing the performance bottleneck, which should be great except for 
one thing:  All our mp code involves DBI (& DBD-mysql), but DBI is not 
thread-safe!

I have a trivial DBI program (not involving mp at all) which crashes on 
Win32 with the delightful "free to wrong pool" error:

use DBI;
use threads;
my $dsn = 'dbi:mysql:test';
my $usr = 'root';
my $pwd = undef;
my $t = threads->new(\&dbsub);
$t->join();
sub dbsub {
  my $dbh = DBI->connect($dsn, $usr, $pwd);
  $dbh->disconnect();
}

When I posted this to the DBI users mailing list looking for a 
resolution, Tim Bunce's response was simply "Don't use threads".  
(http://www.mail-archive.com/dbi-users@perl.org/msg22595.html)

So my expectation would certainly be that if I port my mp1 stuff to mp2 
then it'll all break.  Horribly.

Is there a way to configure mp2 to build with a non-threaded Perl, or at 
least to run it in such a way as to not make use of the Perl 
interpreter's threads, in order to simulate mp1-style behaviour?

I realise that re-introducing the performance bottleneck is not ideal, 
but at least I can live with it.

(The other obvious solution of porting from Win32 to a decent OS is 
sadly not an option before anyone suggests it.)

- Steve


------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are confidential
and intended for the addressee(s) only.  If you have received this message in error or there
are any problems, please notify the sender immediately.  The unauthorized use, disclosure,
copying or alteration of this message is strictly forbidden.  Note that any views or opinions
presented in this email are solely those of the author and do not necessarily represent those
of Radan Computational Ltd.  The recipient(s) of this message should check it and any attached
files for viruses: Radan Computational will accept no liability for any damage caused by any
virus transmitted by this email.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message