use threads; sub gettid { syscall 224 } sub diag { print "pid=$$ tid=@{[threads->tid]} gettid=@{[gettid]}\n"; } async { diag }->detach for 1..5;