Brian,

I have tried fork(), threads, Thread - none of them work.
So far opening a pipe for reading open (CM,"gpresult |" ) and system() function 
proved to work in uncompiled script. The latter is quite interesting since it 
does a hidden fork() for you.
All what I am trying to achieve is running findfile  animation to spice up 
users' passtime while shell utilities running on the background.
Modules used in this script are Win32::OLE, Win32::GUI::Loft, Win32();

A working example of the multi-thread implementation in the GUI script would be 
much appreciated.

Thank you,

  ----- Original Message ----- 
  From: Brian Millham 
  To: 'Igor Anufriyenko' 
  Sent: Wednesday, December 28, 2005 11:58 PM
  Subject: RE: [perl-win32-gui-users] PerlApp issue


  I'm surprised that this works at all, even as a script.  I'd expect the 
animation to hang, because the script is stopped waiting for your gpresult 
program to run.



  You may want to consider running gpresult in a separate thread.



  Brian Millham
  This message traveled at least 44,000 miles to reach you!
  Creator of the DW6000 Monitor
  http://www.millham.net/dw6000
  [EMAIL PROTECTED] 

  -----Original Message-----
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Igor 
Anufriyenko
  Sent: Wednesday, December 28, 2005 10:34 PM
  To: perl-win32-gui-users@lists.sourceforge.net
  Subject: [perl-win32-gui-users] PerlApp issue



  Hello,



  After compiling Win32::GUI script with PerlApp PDK 6.0.2 and running it as 
EXE  Animation control freezes while fork() or system() are executed on the 
background to run CPU-intensive processes.

  However, uncompiled .PL script runs fine - AVI file is being played OK.

  Does anybody have a workaround ? or had a similar issue?



  code looks similar to this:



  sub btn_Start_Click {

  $animation->Open(file.avi);

  $animation->Play(0,-1,-1);

  $animation->Show();

  &runsomething();

  }

  sub runsomething {

  open CH, "gpresult |";

  while (<CH>) {

  #do something...;

  }

   # or :

  system("gpresult");

  close CH;

  }



  As mentioned above, perl script.pl runs just fine, though child process 
utilizes up to 99% of CPU time.

  I have tried DoEvents() with no effect whatsoever.



  Thank you,

  Igor.

  ---
  avast! Antivirus: Outbound message clean.
  Virus Database (VPS): 0552-1, 12/28/2005
  Tested on: 12/28/2005 11:58:16 PM
  avast! is copyright (c) 2000-2003 ALWIL Software.
  http://www.avast.com




Reply via email to