I got a new PC at work today (yaaaaay). This one has 3 times the amount of memory and is about 2.5 times faster. On the plus side, it's faster. On the minus side, it means I'll be on GDNet less, since I no longer have time to post between compiles...
My socket code is nearly complete. I got connect code working yesterday on the way home, and then realised that my listen/connect thread just needs to be a listen thread, since connect notifications will go to the worker threads along with read, write and close. So I tidied up my code a bit and made the listen thread totally different from the worker threads. I'm currently fixing the thread sorting code, so it's a bit more balanced, and probably more robust.
This time, I mutex lock every thread (Yeah, I know that's A Bad Thing), process any add/remove socket notifications (it makes my life easier, I've got less to worry about), count the total number of connections, work out how many threads that should take, and then load-balance it a bit.
Anyway, I'm getting back to my code...
Jack