remembering how fucking dumb I am by trying to write threaded code and realizing I did a stupid bad shitty dumb thing in how I architected this server. Of fucking course having 2 threads listening to 1 port is going to cause a race condition and im an absolute dumbshit
You can have as many threads or processes listening on the same port as you want with SO_REUSEPORT. The "several threads calling accept()" pattern is also not uncommon, though not as good as SO_REUSEPORT.
-
-
I am aware of this fact. This is not the issue. The issue is that I forgot an edge case that resulted in 2 threads racing for control of the port.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.