Perhaps you'll find this a more convincing demonstration of concurrency?
Each of four threads continuously prints its own thread id (a number from 1.. 4) to the screen; while the 5th (main) thread waits for you to hit enter:
perl -Mthreads -e"$|++;async{print threads->tid while 1}->detach for 1 + .. 4; <>"
Switch "s for 's if you're on *nix.
In reply to Re^3: multithreading sample needed
by BrowserUk
in thread multithreading sample needed
by sweepy838
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |