uNetworking / uSockets

Miniscule cross-platform eventing, networking & crypto for async applications
Apache License 2.0
1.29k stars 268 forks source link

Multithreading in Windows #74

Closed MarouaneMan closed 4 years ago

MarouaneMan commented 5 years ago

Hello,

First of all, thank you for this work, I gave it a test and it's blazing fast. I just have a little problem, the current proposed multithreading solution has no effect on Windows because SO_REUSEPORT is not supported and does anything, so only one thread will get connections. Is there anyway to implement multithreading in the listener?

Thank you.

ghost commented 5 years ago

Hi,

It should work as is. I'm pretty certain I have tested this as some point, even though Windows is by far a third-class platform.

Definitely aim for Linux if you are interested in performance.

MarouaneMan commented 5 years ago

I made a test again and unfortunately only the first created thread accepts connections.

Can't switch to linux for technical reasons but thanks anyway.

ghost commented 4 years ago

I've tested this on windows and it does accept connections on all threads. You don't get any particular guarantee but that's what happens if you load the system

ghost commented 4 years ago

I can't do anything about this report