> From: Hindrik Buining
> Sent: Friday, 22 August 2003 11:54 AM
> In threaded mode, freeradius drops the request if there are no threads
> available.
> In non-threaded mode, it doesn't process the requests fast enough for my
> needs.
> To get around the situation I wrote the following patch which does two
> things:
> 1. It increases the buffer size of the udp socket so the OS will buffer udp
> packets
> 2. It checks to make sure a thread is available to handle the request before
> it reads from the socket. If a thread is not available it sleeps for a mili
> second and tries again.
I seem to remember this being a long-standing TODO. Thankyou. However...
> ***************
> *** 887,892 ****
> --- 913,924 ----
> }
> #endif
> +
> + while( !threads_available() ) {
> + radlog(L_ERR, "No threads available yet. Sleeping...");
> + select(0,NULL,NULL,NULL,&sleep_time);
> + }
> +
> status = select(max_fd + 1, &readfds, NULL, NULL, tv);
> #ifndef HAVE_PTHREAD_H
> /*
Shouldn't the loop appear after the select? That way if
there's no pending requests in the socket buffer, we don't
busy-wait needlessly when an io-wait would suffice.
It prolly shouldn't be an L_ERR either... That seems too
severe for something that loops every 1000us.
--
=========================================================
Paul "TBBle" Hampson
Bubblesworth Pty Ltd (ABN: 51 095 284 361)
[EMAIL PROTECTED]
This is a one line proof...if we start
sufficiently far to the left.
-- Cambridge University Math Department
---------------------------------------------------------
Random signature generator 3.0 by Paul "TBBle" Hampson
=========================================================
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html