How many threads is too many?

前端 未结 12 689
死守一世寂寞
死守一世寂寞 2020-11-22 16:49

I am writing a server, and I send each action of into a separate thread when the request is received. I do this because almost every request makes a database query. I am usi

12条回答
  •  花落未央
    2020-11-22 17:40

    In most cases you should allow the thread pool to handle this. If you post some code or give more details it might be easier to see if there is some reason the default behavior of the thread pool would not be best.

    You can find more information on how this should work here: http://en.wikipedia.org/wiki/Thread_pool_pattern

提交回复
热议问题