Re: Help needed
[email protected] (Dean Arnold) Wed, 07 Feb 2007 08:37:37 -0800
| Newsgroups | perl.ithreads |
|---|---|
| Message-ID | <[email protected]> |
BTR Naidu wrote: > Hi, > > I wanted to write a perl script in which there are 10 threads created and > all these 10 threads should be executed in 10 different command window. > The > thread is running under windows. > > Did lot of google but no info on the same. Can anybody help me in solving > this? > You failed to mention which OS you're targeting ? With some effort, a Perl/Tk UI might be a reasonable alternative; but you'll need to run Perl/Tk in its own thread, and use a Thread::Queue (or Thread::Queue::Duplex) to communicate between the threads and the UI widgets. Pseudocode-wise: create 10 Thread::Queue's Start Perl/TK in a thread Perl/Tk creates 10 TopLevel text widgets Perl/Tk polls the queues for activity start 10 threads, handing each their own queue Alternately, on Win32, you might start 10 cmd.exe's via Win32::Process, and communicate via pipes. I'm certain there's an equivalent in *nix using /dev/tty or somesuch, but my POSIX system programmer skills are a bit rusty. Dean Arnold Presicient Corp.