Comentários no código 2 – Apache

E a bola da vez é o Apache. Quer ganhar pizza e cerveja grátis? Sirva dois bilhões de requisições ou tente (e consiga!) executar o apache com mpm-worker em uma máquina de 16 bits:

/* requests_this_child has gone to zero or below.  See if the admin coded
   "MaxRequestsPerChild 0", and keep going in that case.  Doing it this way
   simplifies the hot path in worker_thread */

static void check_infinite_requests(void)
{
    if (ap_max_requests_per_child) {
        signal_threads(ST_GRACEFUL);
    }
    else {
        /* wow! if you’re executing this code, you may have set a record.
         * either this child process has served over 2 billion requests, or
         * you’re running a threaded 2.0 on a 16 bit machine.
         *
         * I’ll buy pizza and beers at Apachecon for the first person to do
         * the former without cheating (dorking with INT_MAX, or running with
         * uncommitted performance patches, for example).
         *
         * for the latter case, you probably deserve a beer too.   Greg Ames
         */

        requests_this_child = INT_MAX;      /* keep going */
    }
}
 

Veja o código no repositório do apache.

This entry was posted in Geek life and tagged , , . Bookmark the permalink.

3 Responses to Comentários no código 2 – Apache

  1. Hahahaha

    Só tem loco programando!

  2. Cara, se você topar com um código meu um dia você pode acabar lendo algum pequeno conto que eu escrevo quando estou cansado de ver código =)
    O GeSpeak mesmo deve ter uns 3 minicontos.

  3. hehe, já tou lendo o código do gespeak aqui!

Deixe um Comentário

O seu endereço de email não será publicado Campos obrigatórios são marcados *

*

Você pode usar estas tags e atributos de HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>