httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: Question. fopen() in ap_pfopen() background ?
Date Tue, 12 Oct 1999 11:07:01 GMT
Ryan Bloom wrote:
> 
> > > This is not true.  APR uses both file descriptors as well as FILE *'s,
> > > depending on what the situation calls for.
> >
> > it would be nice if we could avoid ever using FILE *... a project for
> > someone.
> 
> It wouldn't be hard, we would just need to put our own buffering into APR.
> For the sake of getting APR up and working and stable, I decided to use
> what was available for the first version of APR.  I would think that in
> APR 1.1, we could probably get buffering into APR itself, and remove the
> need for FILE *'s completely.  I agree, it does make somethings ugly to
> have those FILE *'s in there.

I do understand that FILE* can avoid a kernel context switch by
buffering in libc, but is there really a big perf gain? Don't most
modern operating systems provide plenty of builtin buffering?

i.e. why write it ourselves when the OS will usually do fine?

Hrm... what I'm trying to say is: can anybody characterize the actual
different between an fd and a FILE* on a good OS?

Cheers,
-g

p.s. obviously, I've never run this perf test... if there really is a
big difference, then I'll shut up now :-)

--
Greg Stein, http://www.lyra.org/

Mime
View raw message