September 2017
Beginner
402 pages
9h 52m
English
In Perl 6, there is the Thread class, which takes care of creating and running threads. To see in which thread you are at the moment, use the $*THREAD pseudo constant:
say $*THREAD;
It returns a value of the Thread class, and the default stringified representation of it is a string containing the identifier and the name of the thread:
Thread #1 (Initial thread)
Don't rely on the particular value of the thread identifier as it may be different even for the main thread.
Read now
Unlock full access