Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Perl should start to specify which functions and modules are thread-safeby pg (Canon) |
on Feb 02, 2003 at 18:41 UTC ( [id://232024]=perlmeditation: print w/replies, xml ) | Need Help?? |
As we saw in c, it always specifies what is safe with thread, what is unsafe. For example, strtok is unsafe with thread. Perl does not do this, and this is extreamly dangerous. Of course, it is not a surprise to me, as Perl only started to have this real thread stuff since 5.8. However Perl should start this ASAP, otherwise it will bite everyone. For example, I found Tie::File is not safe with thread. Try the following code on win32, see how account.txt is messed up.
Foot Notes: This post is for a general purpose, and it is not about Tie::File. Tie::File is just an example, and is the point where I started to think about this.
Back to
Meditations
|
|