http://www.perlmonks.org?node_id=425024


in reply to Re: RFC: Implicit Parallelization Pragma
in thread RFC: Implicit Parallelization Pragma

Let's assume first that the {use threadsafe; ...} means that the contents of this block may be parallelized.

This is what I intended.

The programmer would have to be very very carefull then and it would take him ages to validate each and every subroutine that might get called. And the bigger the task (and thus the better candidate for parallel execution) the harder would it be to validate it. So I doubt people would use this often, if at all.

If you want any concurrency without this, then you need to use fork() or threads. In that case, you still need to verify that your code doesn't have concurrency issues. A use threadsafe around important portions would take no more work than existing solutions, and is likely to take less since only code explicitly inside a threadsafe block would need to be checked.

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.