The thread safety of most functions in perl depends on their C routines, and in the case of built-in modules, such as push , there is no mention of thread safety, so you should assume that it is not.
perlthrtut out the perlthrtut man page, in particular the "Basic semaphores" section. Using a semaphore, you can provide mutual exclusion in arbitrary sections of code.
maerics
source share