]> code.citadel.org Git - citadel.git/commitdiff
* comment
authorArt Cancro <ajc@citadel.org>
Tue, 26 Aug 2003 19:47:30 +0000 (19:47 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 26 Aug 2003 19:47:30 +0000 (19:47 +0000)
citadel/sysdep.c

index bc3db99164f10991ec1dd8eb2054fe7f095bbc0d..988acd9dc8ae5fffa6d11248999d39b38f71e8b2 100644 (file)
@@ -945,12 +945,14 @@ void *worker_thread(void *arg) {
 
                /* 
                 * A naive implementation would have all idle threads
-                * calling select() and then they'd all wake up at once.  We
-                * solve this problem by putting the select() in a critical
-                * section, so only one thread has the opportunity to wake
-                * up.  If we wake up on a master socket, create a new
-                * session context; otherwise, just bind the thread to the
-                * context we want and go on our merry way.
+                * calling select() and then they'd all wake up at once
+                * (known in computer science as the "thundering herd"
+                * problem).  We solve this problem by putting the select()
+                * in a critical section, so only one thread has the
+                * opportunity to wake up.  If we wake up on a master
+                * socket, create a new session context; otherwise, just
+                * bind the thread to the context we want and go on our
+                * merry way.
                 */
 
                /* make doubly sure we're not holding any stale db handles