Thread Module
Every thread module includes
Use threads
Class methods
new() –create a new threads
create()-create a new thread
self() – Return my current thread object
list() – Return list of thread objects
Thread objects methods
join – propagate errors (harvest thread)
eval – trap errors (harvest a thread)
equal –compare two threads for identity
tid – return the internal thread id
Creation of threads
Using two methods we can create threads
1.New()
2.Create()
New() method
$thr=threads->new()
use threads;
$thr = threads->new(\&sub1);
sub sub1
{
print "welcome to all \n";
}
No comments:
Post a Comment