"Tid" is the thread id which is unique and is given to each thread
thread->list returns a list of thread objects, one for each thread that's currently running
foreach my $thr (threads->list()) {
##DO something
}
Read
Threads for more information, it's not best but you can refer it for list purpose.
Update:
<$thr->is_running()
Returns true if a thread is still running (i.e., if its entry point function has not yet finished or exited).
$thr->is_joinable()
Returns true if the thread has finished running, is not detached and has not yet been joined.
In other words, the thread is ready to be joined, and a call to $thr->join() will not block.
threads->list()
threads->list(threads::all)
threads->list(threads::running)
threads->list(threads::joinable)
With no arguments (or using threads::all ) and in a list context, returns a list of all non-joined,
non-detached threads objects. In a scalar context, returns a count of the same.
With a true argument (using threads::running ), returns a list of all non-joined,
non-detached threads objects that are still running.
With a false argument (using threads::joinable ), returns a list of all non-joined, non-detached
threads objects that have finished running (i.e., for which ->join() will not block).
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.