Kyle R . Burton on Fri, 13 Apr 2001 13:44:08 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[mortis@voicenet.com: Re: FW: question about xs]


Forgot to CC the list...

----- Forwarded message from "Kyle R . Burton" <mortis@voicenet.com> -----

Delivered-To: mortis@unix01.voicenet.com
Delivered-To: mortis@voicenet.com
Date: Fri, 13 Apr 2001 13:42:34 -0400
From: "Kyle R . Burton" <mortis@voicenet.com>
To: "Sollenberger, Gandalf" <Gandalf.Sollenberger@isinet.com>
Cc: "'mortis@voicenet.com'" <mortis@voicenet.com>
Subject: Re: FW: question about xs
Reply-To: "Kyle R . Burton" <mortis@voicenet.com>
X-Mailer: Mutt 095 us
In-Reply-To: <0195B3F7BA68D41199DA00D0B781C3DC01E102E2@mail2.isinet.com>; from Sollenberger, Gandalf on Fri, Apr 13, 2001 at 01:29:17PM -0400

> Just a quick thought, are you aware of the implications of forking under
> mod_perl?   I believe forking defeats the purpose of running under mod_perl
> as when you fork, you make a copy of the entire webserver.  I would think
> you wouldn't want to do this.

Yes, that's why we started the XS, so there wouldn't be a fork.

> Have you tried running the program like this?
> my $cmd = "/path/to/binary";
> my $args = "some args";
> my $tmpfile = "/tmp/.foobar" . $ENV{UNIQUE_ID};
> open(TMP, ">$tmpfile");
> print TMP "$args";
> close(TMP);
> my(@output) = `$cmd < "$tmpfile"`;

Those backticks right there cause a fork.  Even system() causes a fork.
We did the forking and pipes ourselves so we could obviate the need
for temporary files, and so we could keep taint checking on.

> Perhaps this won't work and I don't understand your problem?
> I have some experience with mod_perl, so, if I can help, let me know.
> 
> I know the approach I suggest above isn't very elegant, but it's worked for
> me with a piece of code that was written under lex and yacc with swig that
> didn't behave well under mod_perl.  

What was it doing?  I just did a bit of work with lex/yacc.



P.S. Any employers looking for a Perl/Java/C/C++ developer?

My resume is here:

  http://www.voicenet.com/~mortis/about/resume.html

thanks,
Kyle


-- 
------------------------------------------------------------------------------
   Of course power tools and alcohol don't mix.  Everyone knows power tools 
   aren't soluble in alcohol...      -- Crazy Nigel
mortis@voicenet.com                            http://www.voicenet.com/~mortis
------------------------------------------------------------------------------

----- End forwarded message -----

-- 
------------------------------------------------------------------------------
   Of course power tools and alcohol don't mix.  Everyone knows power tools 
   aren't soluble in alcohol...      -- Crazy Nigel
mortis@voicenet.com                            http://www.voicenet.com/~mortis
------------------------------------------------------------------------------
**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**