in reply to Re^4: Perl/Tk Multithreading
in thread Perl/Tk Multithreading

Because of these modules the thread is ending abnormally.

That is not enough information for us to determine anything!

This simple demo does all the steps you've outlined and works.

This is the called .pl file that loads a module and uses it:

#! perl -slw use strict; use Time::HiRes qw[ time sleep ]; print 'test.pl started loading'; sub doit { print 'doit called'; for( 1 .. 5 ) { print scalar time; sleep 1.5; } print 'doit() finished'; } print 'test.pl finished loading';

And this is the program that loads that in a thread:

#! perl -slw use strict; use threads; sub testit { do 'test.pl'; } async { print 'before testit()'; testit(); print 'after testit()'; doit(); }->join;

And this is the result of running it:

[18:40:12.57] C:\test>914924.pl before testit() test.pl started loading test.pl finished loading after testit() doit called 1310924420.797 1310924422.29803 1310924423.79802 1310924425.29802 1310924426.79802 doit() finished

That took me about 45 seconds to write and run. Now how about you make some effort.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.