Hi everybody,
well during the discussion of the concurrency capabilities of
Python, I found this article reading worthwhile:
http://chriskiehl.com/article/parallelism-in-one-line/ His statement
"Mmm.. Smell those Java roots." basically sums the whole topic up
for me.
That is sequential code (almost plain English):
for image in images:
create_thumbnail(image)
In order to have a start with parallelism and concurrency, we need
to do the following:
pool = Pool()
pool.map(create_thumbnail, images)
pool.close()
pool.join()
Not bad (considering the other approaches), but why couldn't it not
look just like the sequential one, maybe like this:
for image in images:
fork create_thumbnail(image)
What I like about the Pool concept is that it frees me of thinking
about the interprocess/-thread communication and processes/threads
management (not sure how this works with coroutines, but the experts
of you do know).
What I would like to be freed of as well is: pool management. It
actually reminds me of languages without garbage-collection.
Regards,
Sven