I said it was trivial:)
#! perl -slw use strict; use threads; use threads::shared; my @myarray : shared; sub pid { lock @myarray; push @myarray, $_[ 0 ]; } threads->new( \&pid, $_ )->detach for 1 .. 3; sleep 2; print "@myarray"; __END__ [23:30:52.15] P:\test>417163 1 2 3
In reply to Re^2: simple IPC
by BrowserUk
in thread simple IPC
by keithw99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |