Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use thread pool for handling connections #23

Open
TheHashTableSlasher opened this issue Jun 12, 2020 · 0 comments
Open

Use thread pool for handling connections #23

TheHashTableSlasher opened this issue Jun 12, 2020 · 0 comments
Labels
low priority Other things should be worked on first optimization Improvements to code quality or efficiency server Relates to the server code

Comments

@TheHashTableSlasher
Copy link
Collaborator

From README.md:

That having been said, multi-threading may not be avoided in the future. A technique used by several HTTP servers to tackle the C10k problem (e.g. Nginx, lighttpd) is to have a fixed-size pool of worker threads that each poll a set of client connections dispatched to them by the main thread. (An excellent article on the I/O performance of threads vs poll/select can be found here.) This approach may be used by this code in the future, if such scalability is desired.

Note that multi-threading would greatly increase the complexity of the server, and might actually make it slower due to locks on tables starving certain threads. Still, for maximum performance and scalability it may be worth considering in the future.

@TheHashTableSlasher TheHashTableSlasher added optimization Improvements to code quality or efficiency low priority Other things should be worked on first server Relates to the server code labels Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low priority Other things should be worked on first optimization Improvements to code quality or efficiency server Relates to the server code
Projects
None yet
Development

No branches or pull requests

1 participant