]> code.citadel.org Git - citadel.git/commitdiff
Removed the comments about not needing to block on select() , after remembering that...
authorArt Cancro <ajc@citadel.org>
Sat, 25 Jun 2022 17:25:32 +0000 (13:25 -0400)
committerArt Cancro <ajc@citadel.org>
Sat, 25 Jun 2022 17:25:32 +0000 (13:25 -0400)
citadel/server/sysdep.c

index 6446a108348a745f677e358b593dbef4d0c11e06..0a84e73530eefa612e1844fbf0cfa940ae2f8b77 100644 (file)
@@ -816,16 +816,12 @@ void HuntBadSession(void) {
 }
 
 
-// This loop just keeps going and going and going...
-//
-// TECHNICAL NOTE -- AJC 2022-JUN-20
-// This loop was designed in the 20th Century when accept() was susceptible to the "thundering herd" problem.
-// Today we can simplify it by having all worker threads block on accept() and the OS will do the right thing when a
-// connection arrives and only unblock one thread.   This will require a separate execution path for non-client activity
-// such as housekeeping but maybe we can move those to a "supervisor thread".
-//
-// This implementation works and is not broken in any way, but if we can simplify it we should.
-//
+// Main server loop
+// select() can wake up on any of the following conditions:
+// 1. A new client connection on a master socket
+// 2. Received data on a client socket
+// 3. A timer event
+// That's why we are blocking on select() and not accept().
 void *worker_thread(void *blah) {
        int highest;
        CitContext *ptr;