how many threads to run in java?

前端 未结 9 606
时光取名叫无心
时光取名叫无心 2021-02-03 16:05

I had this brilliant idea to speed up the time needed for generating 36 files: use 36 threads!! Unfortunately if I start one connection (one j2ssh connection object

9条回答
  •  日久生厌
    2021-02-03 16:37

    You need to understand that if you create 36 threads you still have one or two processors and it would be switching between threats most of the time.

    I would say you increment the threads a little bit, let's say 6 and see the behavior. And then go from there

提交回复
热议问题