ukhas jean wrote:

> Hello All,
>  
> Well the query i am about to ask may seem amatuerish, but i am asking it
> newayz...
> hope u gurus might not mind me asking such a thing ....
>  
> I had the following code :-  
> use threads;
> $thr = threads->new(\&sub1);

Try it with :
  sleep 1;
to give the thread a chance to print.

> sub sub1
> {
>  print "Inside the thread\n ";
> }
>  
> O/p comes:-
> A thread exited while 2 other threads were still running.
> I am using Perl 5.8.0 on Win XP.
> Plz note:- The content in the subroutine is not printed. I read it
> somewhere that we need to pass the reference of the subroutine to the
> new() method. But on doing so, the print statement in the subroutine is
> not getting executed.
>  
> So i removed the reference and made the statement as:-
> $thr = threads->new(&sub1);
>  
> O/p comes:-
> Inside the thread
> A thread exited while 2 other threads were still running.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to