httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <>
Subject Re: cgi performance in Apache-apr.
Date Mon, 03 May 1999 18:28:29 GMT

> I'd say this is a proof of concept, not something I'd want to see
> committed to the repository in either experimental or standard.

fair enough.  I'll go through and clean it up a bit and re-send it to the
list when the clean-up is done a bit.

<Since I agree with everything in the middle, I'll skip it>

> >    fd = open(tmpnames[index], O_WRONLY);
> >    send_req(fd, r, argv0, env);
> >    ap_bpushfd(script_out, fd, fd);
> >
> >    fd2 = open(tmpnames[index + 1], O_RDONLY);
> >    ap_bpushfd(script_in, fd2, fd2);
> >
> >    fd3 = open(tmpnames[index + 2], O_RDONLY);
> >    ap_bpushfd(script_err, fd3, fd3);
> There's a race condition -- you should open all the fds first before
> sending the request.  Otherwise the daemon may pick up and start
> writing before the pipes are open on both sides.

Actually, the behavior I was seeing was that the opens blocked until both
sides were ready for read/write.  REgardless, it does make more sense to
send the request when all three files are open, I had done that at the
beginning, and moved it up to help my debugging.

This begs another question, and I hate myself for bringing this up, but
should this just be another way for mod_cgi to run?  I haven't looked into
what that will require, but I see no reason why these changes couldn't be
folded into mod_cgi (when they are ready), and a directive to switch
between the two.


Ryan Bloom
4205 S Miami Blvd	
RTP, NC 27709		It's a beautiful sight to see good dancers 
			doing simple steps.  It's a painful sight to
			see beginners doing complicated patterns.	

View raw message