[fpc-pascal] Threading vs Parallelism ?
jon-lists at jfpossibilities.com
Thu Mar 30 18:29:15 CEST 2017
On 03/29/2017 01:15 PM, Michael Van Canneyt wrote:
> On Wed, 29 Mar 2017, Dimitrios Chr. Ioannidis via fpc-pascal wrote:
>> On 29/3/2017 9:57 μμ, fredvs wrote:
>>> Some developers treat me as dinosaur because I use threads in place of
>>> Huh, ok, but why parallelism is better and how to do it with fpc ?
>> a nice article I've found long ago when I was researching the same
>> topic "Threading/Concurrency vs. Parallelism" is the following :
>> and I tried the multithreadprocslaz package in Lazarus :
> Showing nicely that parallelism in a single process implies threads.
> I would not pay too much attention to what these developers are saying.
Either I'm dense, which is entirely possible, or the author of that article
didn't do a good job of making his point, even assuming he had one.
Thinking about this a bit more I would say that "threads" are a means
(vehicle) to achieve parallelism. I think that in the majority of
programming contexts they are synonymous. But I can think of other contexts
where they may not be: Say animating a film. You have 1000 computers
generating frames to be assembled into a final sequence. The process of
dispatching each frame render is most likely not going to be done with the
OSes thread call, but through a networked work queue of some sort (ala
Torque or something). So you have the "task" (rendering the movie) being
worked on in "parallel" via a networked job dispatch mechanism.
Or the case of using "make -j ..." which "forks" multiple jobs (compile,
link, ...) in parallel based on a dependency tree.
I say threading is parallelism, even if just one form of it. The other
methods of parallelism I mentioned here could also be done in FPC with the
appropriate code. But that is a rather nebulous topic to discuss. Concrete
answers for which are only available when you know how a specific job needs
to be broken up.
I'm still looking for a good easy to use job queue myself...
JF Possibilities, Inc.
jon at jfpossibilities.com
More information about the fpc-pascal