Jump to content
Tommi Prami

Any Good tutorial on Parallel Programming Library?

Recommended Posts

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

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
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
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

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
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
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.

  • Like 3

Share this post


Link to post

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

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? 

  • Like 2

Share this post


Link to post

How BIG is big, if you only use a small part of it ?

Share this post


Link to post

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...

  • Like 2

Share this post


Link to post
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.

  • Like 1

Share this post


Link to post
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 by Tommi Prami

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×