> 
> On Tue, Jan 15, 2002 at 09:51:28AM +0000, Simon Oliver wrote:
> > Beware if runing ActiveState perl.  ActivePerl is compiled with iThreads,
> > which is not compatible with Storable
> 
> Why not?
I've mentioned this before.  The problem is that Storable is not thread safe
so it doesn't work under fork emulation.  The only solution on Win32 is to
compile your own perl using old style Threads support.

> Does the author know?
This is really a problem with iThreads and fork emulation.

> Do p5p and/or ActiveState know?
I contacted ActiveState and the author or PlRPC.

> Is the problem being worked on by anyone?
Not that I know of.  In my opinion the way round this is for PlRPC to
facilitate the choice of other persistence modules - Data::Dumper would be
good because it is included with core (I guess it is slower but a working
daemon is better than none at all).  I have been meaning to write a patch to
RPC::PlServer::Comm to sort this out but have not had time.


I've attached some emails on this subject.  I submitted a bug report but have
had no reply to date.

http://bugs.activestate.com/cgi-bin/bugzilla/show_bug.cgi?id=17253

--

  Simon Oliver


Subject: 
        [Bug 17253] Following up on bug 1323 - The fork() emulation has known
limitations. See perlfork for a detailed
        summary. In particular, fork() emulation will not work correctly with
extensions that are either not thread-safe, or
        maintain internal state that cannot be cloned in the psuedo-child
process. This caveat currently applies to
        extensions such as Tk and Storable.
   Date: 
        29 Aug 2001 11:48:16 -0000
   From: 
        Bugzilla Mailinterface <[EMAIL PROTECTED]>
     To: 
        [EMAIL PROTECTED]




ActiveState Bugzilla

Your Bugzilla email request was successful. A new bug has been created with
and it can be 
viewed here at
http://bugs.activestate.com/cgi-bin/bugzilla/show_bug.cgi?id=17253
  
Bugzilla found the following warnings (not critical):

    Priority has been set to the default (3-Medium).
    Bug severity has been set to the default value (Unknown).
    Hardware has been set to the default value (Unknown).
    Operating System has been set to the default value (Unknown).





Subject: 
        Re: Net::Daemon
   Date: 
        Wed, 29 Aug 2001 10:44:16 +0100
   From: 
        "Simon Oliver" <[EMAIL PROTECTED]>
     To: 
        <[EMAIL PROTECTED]>
    CC: 
        <[EMAIL PROTECTED]>




Joe, hope you don't mind me contacting you but i thought you would be
interested in this:

Found out what the problem is with threads and Net::Daemon (and any modules
that depend on it such as DBI::Proxy, RPC::PlServer, etc) and the current
ActiveState build of perl...

To trace the problem I commented out line 75 in Log.pm and replaced it with
my $tdi = '' to get things working - then the server starts up but as soon
as a client tries to connect I get the following  error:

This perl was built for "ithreads", which currently does not support
Thread.pm.
Run "perldoc Thread" for more information at C:/Perl/site/lib/Net/Daemon.pm
line
 451.

This document says...
    "... If you are using a binary distribution such as ActivePerl that is
built with ithreads support, this extension CANNOT be used."

What is odd is that ActiveState actually provide precompiled versions of
Net::Daemon and PlRPC but make no mention of the fact that their build of
Perl doesn't support the Thread module.  This fact makes all the Net::Daemon
modules practically useless as the only mode of operation thus supported is
'single'.

I could of course recompile perl with Thread support instead but that would
appear to be a backward step and woudl make any modules I write
unsupportable on "standard" Win32 machines, most of which do not have C
compilers.

This poses a number of questions for yourself and ActiveState (that's why
I've cc'd it to them too):

1.  Will Net::Daemon be updated to use ithreads?
2.  Why do ActiveState include the Thread modules when it clearly isn't of
any use with their distribution!
3.  I can't find any documentation on ithread and its usage - at least not
in the standard perl docs.

--
  Simon Oliver

----- Original Message -----
From: "Simon Oliver" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, August 23, 2001 10:50 AM
Subject: Net::Daemon


> I'm running "perl, v5.6.1 built for MSWin32-x86-multi-thread" - the
current
> ActiveState release.  The versions of Net::Daemon and Net::Daemon::Log
(from
> the ActiveState ppm packages) are 0.31 and 0.1 respectively.
>
> When i try to run my perl script using Net::Daemoin I get:
>
> Can't call method "tid" on an undefined value at
> C:/Perl/site/lib/Net/Daemon/Log
> .pm line 75.
>
> So I tried running the example calculator server code in Net::Daemon man
> page and got the same error message.
>
> Looking at the code in Net::Daemon::Log.pm I see at line 75:
>
>     my $tid = (ref($self)  &&  $self->{'mode'}  &&
>         ($self->{'mode'} eq 'threads'))
>  ? (Thread->self->tid() . ", ") : '';
>
> which indicates that tid is called with no parameters - I guess that's
> what's causing the error?
>
> I have used Net::Daemon in the past with an earlier version of Perl
without
> problem.
>
>
> Is there a quick way to get this running (I don't need logging at the
moment
> but will in the future)
>
> --
>   Simon Oliver
>





Subject: 
            Re: iThreads (DPR#7120)
       Date: 
            Fri, 14 Sep 2001 21:35:30 +0100
      From: 
            "Simon Oliver" <[EMAIL PROTECTED]>
        To: 
            "andy" <[EMAIL PROTECTED]>
 References: 
            1




Hi Andy,

> > Found a problem with Threads and Net::Daemon (and any modules
> > that depend on it such as DBI::Proxy, RPC::PlServer, etc) and the
current
> > ActiveState build of perl...
I checked through the support site and buglist at ActiveState and found a
number of simillar reports and the answer was to use fork emulation, but...

the problem is due to the fact that using iThreads as a fork emulator only
works with thread safe modules - RPC::PlServer uses the Storable modules
which is not thread safe and so all modules based on RPC::PlServer are
effectively restricted to single connection mode only.

>From perlfork:

"Since the fork() emulation runs code in multiple threads, extensions
calling into non-thread-safe libraries may not work reliably when calling
fork(). As Perl's threading support gradually becomes more widely adopted
even on platforms with a native fork(), such extensions are expected to be
fixed for thread-safety. "

>From Release.HTML:

"The fork() emulation has known limitations. See perlfork for a detailed
summary. In particular, fork() emulation will not work correctly with
extensions that are either not thread-safe, or maintain internal state that
cannot be cloned in the psuedo-child process. This caveat currently applies
to extensions such as Tk and Storable. "

This seriously impacts on the usefullness of ActivePerl as a viable tool for
implementing network applications - at least on the Win32 platform.

If ActivePerl cannot see any immediate remedy to the problem a warning
should be added to perlport, Winfaq, DBI::Proxy, RPC::PlServer and any other
module that fork emulation might cause problems on.

> This is really outside the scope of support.
I didn't really want support - I tried on a number of occasions to submit a
bug report at ActivePerl but each time the form dies with an error - out of
despiration I emailed a bug report but this is the first reply I have had
from ActiveState!

> I would suggest posting message to
> one of the perl-win32 mailing lists where the comments could be discussed
> further.
Did that but got no replies.

>If you feel this is really a bug in ActivePerl you could post a bug at
> http://bugs.activestate.com/ActivePerl
As I said I did that too!

> Thanks.
You're welcome.

--
  Simon Oliver

Reply via email to