Next | 1.1 Creating threads | Prev |
Every multi-threaded program should include:
use threads;
New threads are created using:
which returns the thread object. A more complete example:threads->new(\&thread_sub, @sub_params)
create() is a synonym for new().use threads; $thr1 = threads->new(sub { ... code 1 ... }); $thr2 = threads->new(sub { ... code 2 ... }, $param1, $param2);
Next | Perl Threads | Prev |