Delphi-Promises use of the threading module #12
Replies: 3 comments 1 reply
-
|
Thanks for your feedback! To be honest, there is no specific reason why The reason why I choose to implement a custom thread pool is that we want full control over it. Relying on the amount of thread in the System.Threading engine would be too risky. In our real-world situations, we have seen that 50+ threads are not enough in some situations (especially when using |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the explanations. I know I am probably asking too much, but It would be nice if there was an option to use the threading module instead of the custom pool. This would help avoid operating two thread pools in parallel for users that;
|
Beta Was this translation helpful? Give feedback.
-
|
Feel free to create one and experiment with it. If it performs better in all situations we could replace the current one or make it optional. I am very curious about your PR. One question, what is your main reason to reduce the resource usage? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Congratulations for this excellent work!
After superficially looking at the source code, I saw that you use the System.Threading.TTask to run the long running procedure ControlPool. On the other hand you use a custom thread pool with worker threads to run everything else. ControlPool creates a minimum of 10 worker threads at start (sounds wasteful for light usage, even if the overhead of creating threads is not large).
I always thought that TTask is for short tasks. For long-running tasks (in this case for the lifetime of the application) you are better off to create a dedicated thread. Instead the procedures you run in the custom pool, sound like ideally suited for TTask.
Could you please explain:
Beta Was this translation helpful? Give feedback.
All reactions