Closed viswamy closed 5 years ago
@vswamy thanks for reporting! Do you think you'd be able to provide a PR with a fix? I'd be happy to review it and merge it!
@vswamy Thanks you, i moved this code before creating executor. So i think now it works correctly
So fast. Thanks @Dead-off
I have another concern related to how the number of threads are created. The Executor is created when the class get's loaded by jvm and usually happens when the application is booting up that is, when most of the processors (cpu) is free.
Looking at the documentation of availableProcessors: ` /**
Should we be resetting the executor as the time goes by to reflect the CPU capacity available?
I want to create new class for creating torrent metadata. I don't like so many static classes and fields, it's bad style. I will try to create new api soon and resolve this problem there
Cool.. Thanks a lot
Thanks @Dead-off; closing this issue now then.
The static variables and blocks are executed in order they are specified in the java file. The hashing executor is created before the configuration is read from the system environment and therefore this configuration is never reflected in the code.
https://github.com/mpetazzoni/ttorrent/blob/db52f13ba709b26d9605d7ef18739cdaa7c5fc6d/common/src/main/java/com/turn/ttorrent/common/TorrentCreator.java#L364