Squid internal overview Squid main loop - src/main.c After setup, squid does two things in the main loop Run the next event or events which are ready -eventRun() Handle pending network and disk IO - comm_select() main() { /* Various setup tasks */ for (;;) { /* Check for reconfiguration, log rotation, or shutdown */ eventRun(); /* Run next events */ loop_delay = eventNextTime(); /* Get the time to next event */ comm_select(loop_delay); /* Wait for network IO */ } }