in reply to Re^4: Parrot, threads & fears for the future.
in thread Parrot, threads & fears for the future.
I think it would be safer to have a "parallel map" function instead. In either way the problem is that people would not normaly think neither about adding the pragma nor using the parallel map. Plus there is another problem. The question is not just whether perl may execute the map in parallel, but also in how many chunks. You would of course not want to create a thread for each and every element of the array/list especially if it's huge and the operation is simple. The number of threads you will want to use depends on the complexity and nature of the action you want to do with the elements - you will want more threads if you will spend most time waiting for a network response, you will want less if it's just computation ... So without knowing what's the operation, the implementation of the mapp will not know how to parallelize the operation to achieve good performance. So even though mapp is a nice interface to parallelization, you will want to be able to give it a few more hints to ensure it works well.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Parrot, threads & fears for the future.
by AK108 (Friar) on Oct 26, 2006 at 18:08 UTC | |
by Jenda (Abbot) on Oct 26, 2006 at 21:57 UTC | |
by AK108 (Friar) on Oct 27, 2006 at 16:34 UTC |