in reply to Win32::GUI window freezing, even with threading.

Try like this Re: threads causing memory leak (No leak!)(Win32::GUI DoOneEvent threads poll) , maybe organized like this
#!/usr/bin/perl -- use strict; use warnings; use threads; use Thread::Queue; ## how $guithread and $mechthread communicate my $DataQueue = Thread::Queue->new(); my $guithread = threads->create( sub { require MyApp::GUI; ## MyApp/GUI.pm MyApp::GUI::go(@_); ## uses timer to check on queue }, $DataQueue, ); my $mechthread = threads->create( sub { require MyApp::Mech; ## MyApp/Mech.pm MyApp::Mech::go(@_); }, $DataQueue, ); $guithread->join; ## wait for gui to finish

Replies are listed 'Best First'.
Re^2: Win32::GUI window freezing, even with threading.
by chute (Initiate) on May 28, 2013 at 05:24 UTC
    That seems to work the exact same way... Which is confusing because both threads should function independently of each other.

      That seems to work the exact same way... Which is confusing because both threads should function independently of each other.

      What seems to work the exact same way (did you adopt that code to your use case)?

      Consider Re: Thread parallel execution (join blocks), and throw Thread::Queue in the mix, does dequeue block like join (what I think BrowserUk hints at)?

      Thread::Queue SYNOPSIS lists a Non-blocking dequeue

        This is the answer. And I feel silly now. I read perlthrtut but not Thread::Queue docs :/