You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2001/11/23 19:08:09 UTC

porting Apache::SubProcess issues

I was looking at porting Doug's Apache::SubProcess to 2.0 as a part of
the core, and here are the issues I've encontered with:

- apr in httpd 2.0 doesn't have the equivalent of ap_spawn_child() from
httpd 1.3.x. You can create a sub-process but it only runs a process,
not a function. There is apr_proc_fork() but it's claimed to be not
portable in apr_thread_proc.h

- the new threads stuff provides an option to pass a function the thread
should start from but this won't work if threading is not available.

So I'm not sure how to proceed. I can provide interface to run an
external sub-process similar to what mod_cgi does, but I've no idea how
can we get into the child context and run some code (not program) via apr.

Also do we want subprocess to be able to spawn a sub-thread in addition
to a sub-process? Or should it reside in Apache::SubThread? Or call it
Apache::Spawn and do both?

here is what rbb says about the ap_spawn_child() issue:

On Friday 23 November 2001 12:25 am, Stas Bekman wrote:

 > I'm porting Apache::SubProcess Perl/XS module to mod_perl 2.0 and after
 > checking the existing APR's API I have found that the functionality
 > existing in ap_spawn_child from 1.3.x has gone. Now you can only run a
 > program/script from the spawned process.
 >
 > Any reason for removing this support? I'm probably not aware of some
 > hidden portablity issues, but by comparing ap_spawn_child from 1.3.x
 > with apr_proc_create() from APR isn't the change is as simple as
 > replacing execve() call with func() call after copying apr_proc_create()
 > into some different function (of course the args should be different)?

Windows doesn't support creating a new process without running a new
program.  I have been looking at creating fork() on Windows, but it is
incredibly non-trivial.

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



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