Tommi Prami 130 Posted February 10, 2020 I would rather use OTL, but can't justify committing it to our repository, for small utility app alone. All PPL tries have failed more than less miserably. And Embarcadero help doesn't have too good examples (Or I can't find them). Ot they are so synthetic and oversimplified. No need to do anything super complicated but still better examples would be good to have easier start... -Tee- Share this post Link to post
Tommi Prami 130 Posted February 10, 2020 Fire up tasks in parallel and feed work to them, way or other, pass work log back and so on. Would be positive to terminate tasks, but that is not that big of a deal right now. Pretty basic stuff, but as I mentioned, I've tried few times to do something with PPL and it seems always been disaster. In way or another. OTL has good documentation and have the book, but as said, can't use it with this. -Tee- Share this post Link to post
eivindbakkestuen 47 Posted February 11, 2020 12 hours ago, Tommi Prami said: I would rather use OTL, but can't justify committing it to our repository, for small utility app alone. Er... the OmniThreadLibrary zip is only 8.8Mb, so... seriously... 😉 Share this post Link to post
Tommi Prami 130 Posted February 11, 2020 3 hours ago, eivindbakkestuen said: Er... the OmniThreadLibrary zip is only 8.8Mb, so... seriously... 😉 Overkill for small utility with only few lines of code. And if no other use (For now at least). Share this post Link to post
Lars Fosdal 1792 Posted February 11, 2020 Since threading is non-trivial, it is hard to make examples that are not either non-trivial or oversimplified. You may find yourself writing quite a bit of scaffolding code, which would have come for free with OTL. Share this post Link to post
Cristian Peța 103 Posted February 11, 2020 If PPL is not working and OTL is overkill why not directly TThread? And you are in control. Share this post Link to post
Tommi Prami 130 Posted February 12, 2020 13 hours ago, Cristian Peța said: If PPL is not working and OTL is overkill why not directly TThread? And you are in control. Always one way to go. Would save some lines of code with PPL. OTL is super cool tough. -Tee- Share this post Link to post
Primož Gabrijelčič 223 Posted February 12, 2020 On 2/10/2020 at 9:07 PM, Tommi Prami said: Fire up tasks in parallel and feed work to them, way or other, pass work log back and so on. My book Hands-On Design Patterns with Delphi covers a Pipeline pattern which I fully implemented in PPL. It may give you some ideas on how to approach your problem. The source code is freely available on GitHub. 3 Share this post Link to post
David Heffernan 2345 Posted February 12, 2020 Why is OTL overkill, and PPL is not? Share this post Link to post
Tommi Prami 130 Posted February 13, 2020 OTL is pretty big library, PPL is already there. In our company it is pretty strict what libraries can be imported to our codebase. I rather use OTL for many reasons, but most likely can't justify it. But I think I am solved all problems, only problem is that with PPL code is pretty ugly. Because no proper way to pass workload and receive result. Not too many lines in this case. PPL would benefit some higher level abstraction and helper classes and so, and most important would be documentation. -Tee- Share this post Link to post
Tommi Prami 130 Posted February 13, 2020 Thanks for all of your help. Good chat 🙂 .Tee. Share this post Link to post
David Heffernan 2345 Posted February 14, 2020 PPL is a library too. It's also quite big. Why does it matter how big a library is? It would seem odd to me that there would be no problem using a library known to have many defects still, over a high quality library. Who in their right mind would choose the lower quality library facing this choice? 2 Share this post Link to post
Rollo62 536 Posted February 14, 2020 How BIG is big, if you only use a small part of it ? Share this post Link to post
Alexander Elagin 143 Posted February 14, 2020 The problem is that OTL is unfortunately Windows only, where it wins hands down. On the other hand, PPL with all its quirks is cross-platform. When porting to Linux, I had to write two versions of the same code, ifdef'd to use OTL on Windows and PPL on Linux. Not an elegant solution but I did not want to touch the working Windows code... 2 Share this post Link to post
Uwe Raabe 2057 Posted February 14, 2020 6 hours ago, David Heffernan said: PPL is a library too. Yes, but it comes with the Delphi installation and thus doesn't need to be maintained externally. I also have customers avoiding additional libraries. Each new one has to be justified to someone, which often turns out to be a tedious process. Not everyone has the power to decide on its own. 1 Share this post Link to post
Tommi Prami 130 Posted February 17, 2020 (edited) On 2/14/2020 at 3:06 PM, Uwe Raabe said: Yes, but it comes with the Delphi installation and thus doesn't need to be maintained externally. I also have customers avoiding additional libraries. Each new one has to be justified to someone, which often turns out to be a tedious process. Not everyone has the power to decide on its own. Word! I would put OTL to our repository right away if it would be up to just me. And make all threading with it. -Tee- Edited February 17, 2020 by Tommi Prami Share this post Link to post