ppl / multithreading

Hello,
Is it possible to (safely) use PPL in a multithreaded setting? I tried using it in a Java multithreaded program but got some "Invalid memory access" and "Cannot allocate memory" errors, etc.
Thanks

On 12/11/2013 03:25 PM, Samir Genaim wrote:
Hello,
Is it possible to (safely) use PPL in a multithreaded setting? I tried using it in a Java multithreaded program but got some "Invalid memory access" and "Cannot allocate memory" errors, etc.
Thanks
Hi Samir.
The PPL implementation assumes a single thread of execution. Therefore, if you want to use it safely in a multi-threaded program, you should force all invocations of PPL services to come from a fixed thread. Even though there might be special cases where it would be safe to use multiple threads, we never really investigated this possibility.
Cheers, Enea.

On 12/12/13 13:02, Enea Zaffanella wrote:
On 12/11/2013 03:25 PM, Samir Genaim wrote:
Is it possible to (safely) use PPL in a multithreaded setting? I tried using it in a Java multithreaded program but got some "Invalid memory access" and "Cannot allocate memory" errors, etc.
The PPL implementation assumes a single thread of execution. Therefore, if you want to use it safely in a multi-threaded program, you should force all invocations of PPL services to come from a fixed thread. Even though there might be special cases where it would be safe to use multiple threads, we never really investigated this possibility.
Actually we did investigate it and making the library thread-safe is in our TODO list. If I remember correctly the main issue is with the handling of temporaries, which should not be difficult to solve. Samir, if having the PPL thread-safe is important to you and you are willing to help a little to achieve that, please let me know. Cheers,
Roberto
participants (3)
-
Enea Zaffanella
-
Roberto Bagnara
-
Samir Genaim