cryptic-game / python3-lib

A python3 libary for cryptic-game microservices

Home Page:https://cryptic-game.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use a thread pool

MaxiHuHe04 opened this issue · comments

Describe the feature you would like
I think we should use a thread pool with a fixed number of threads. There should be a queue where the threads of the thread pool get new requests from. When a new request comes in, it should be placed last onto the queue.

Is your feature request related to a problem? Please describe.
Right now, everytime when there is a new request, a new thread is created. That needs a lot of processing power and is very inefficient. In addition, there is no limit of concurrent threads yet. That means that if there are 200 requests at roughly the same time, 200 threads will be created.

Additional context
We have to keep the running time of every request very low. Otherwise, the next requests will be delayed too much.