How many threads is too many?

前端 未结 12 778
死守一世寂寞
死守一世寂寞 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:44

    One thing you should keep in mind is that python (at least the C based version) uses what's called a global interpreter lock that can have a huge impact on performance on mult-core machines.

    If you really need the most out of multithreaded python, you might want to consider using Jython or something.

提交回复
热议问题