Hi Arnold,

Thanks for your reply.

The OS in which I am running perl is on Windows 2000.  Further, I dont was
to use any UI interface for input/output.  Basically, there are set of
independent activities which I should be performing everyday as a backup.
Now presently I have one perl script which does this in sequence.  This
takes longer time to finish (almost 8 hrs).  Now I wanted to use threads and
perform the tasks in parallel so that it finished sooner.  While doing this,
to know which thread did what and what was its error/output messages, I
wanted to run them(threads) in separate shell window.  Hope I am a bit clear
this time in explaining what I wanted.

Any thoughts?

Appreciate your help.

Thanks and regards
BTR Naidu

On 2/7/07, Dean Arnold <[EMAIL PROTECTED]> wrote:

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.




--
Thankx and Regards

BTR Naidu
+91-99009-22114

Reply via email to