On 2/24/06, Arlie Davis <email@example.com> wrote:
> > Also better use Apache Portable Runtime API for thread operations
> > and might for closing sockets (apr_socket_close as HTTPD does).
> Ok, this is two different issues. First, threads: I looked at using
> APR threads, but there is actually nothing to be gained from doing so.
> The one thread that gets created runs for a very short period of time,
> and does not use the APR at all. Using the APR functions for thread
> management doesn't have any benefit (this is already a platform-
> specific piece), and just gets in the way.
Subversion built over APR, so anyway better use APR functions. Even
for platform-specific stuff. Who can garauntee that APR wouldn't add
some significat code in apr_thread_create for pool management? Another
reason to APR: there are much more people know APR and can read code.
> Second, the call to closesocket. The current technique for stopping
> svnserve is not pretty, but I don't see a better way to do it.
> Calling apr_socket_close could actually cause a serious program
> (segmentation fault), because main() (and the functions that it
> calls) would exit the loop and would very likely touch fields within
> the apr_socket_t instance. If the service dispatcher thread freed
> that memory, by calling apr_socket_close, then main() would be
> touching freed memory. But by closing the socket handle, we insure
> that this cannot happen -- the worst thing that happens is that
> the socket *handle* (not structure) gets closed twice, which is ok.
I've looked to svnserve and didn't find when it closes socket on error?
Received on Sat Feb 25 09:08:03 2006