Re: Need help on Threads to add parallelism.

2008-11-05 Thread p sena
Hi, Instead use fork if your r running unix's, well see how it would work on windows (i think there is a way for fork in active perl too). Threads would not be stable enough but yeah fast. Group the tasks in some dstruct and the for each elem in the dstruct fork out processes and le

Need help on Threads to add parallelism.

2008-11-05 Thread Ningappa Sullalli
(containing the build details) and connects to build server(ABC) through ftp and download the builds for each OS/platforms. It will download individual builds one by one for each OS/platform and taking huge time (almost half a day). Now I want to use Threads feature of the perl to add parallelism to

RE: threads package missing is_running (solvedish)

2008-05-06 Thread Brian Raven
Bill Luebkert <> wrote: > Brian Raven wrote: >> >>> use vars qw ($counter $thr $thread $threads); >> >> Prefer declare variables lexically (i.e. my ...), unless you actually >> need to do otherwise. > > Me too. > >>> # Asynchronous

Re: threads package missing is_running (solvedish)

2008-05-06 Thread Bill Luebkert
Brian Raven wrote: > >> use vars qw ($counter $thr $thread $threads); > > Prefer declare variables lexically (i.e. my ...), unless you actually > need to do otherwise. Me too. >> # Asynchronously join threads. >> $threads = threads->list(); > > Note

RE: threads package missing is_running (solvedish)

2008-05-06 Thread Brian Raven
ho knows how long a > worker thread will spend on one task before saying hello again. This > is essentially how they will talk: > > Worker Threads <-> Master Thread / Services Callback Thread <-> > Windows Services Sorry, but I don't really follow that.

RE: threads package missing is_running

2008-05-06 Thread Brian Raven
[EMAIL PROTECTED] <> wrote: > Brian: > Starting Thread Test > This is the child thread (0 sec) > This is the main thread (1 sec) > This is the main thread (2 sec) > This is the child thread (2 sec) > This is the main thread (3 sec) > This is the main thread (4 sec) > This is the child thread (4 sec

RE: threads package missing is_running (solvedish)

2008-05-02 Thread webmaster
x27;t shutdown after a join() in x number of seconds, Windows would assume the program is not responding. And who knows how long a worker thread will spend on one task before saying hello again. This is essentially how they will talk: Worker Threads <-> Master Thread / Services Callback Thread

RE: threads package missing is_running

2008-05-02 Thread Andy_Bach
Brian: Starting Thread Test This is the child thread (0 sec) This is the main thread (1 sec) This is the main thread (2 sec) This is the child thread (2 sec) This is the main thread (3 sec) This is the main thread (4 sec) This is the child thread (4 sec) This is the main thread (5 sec) This is the

RE: threads package missing is_running

2008-05-02 Thread Andy_Bach
> # The following gives an error that is_running.al is missing. # Tried threads->list (threads::running) to search and compare: gave # bareword error. Tried the code on linux, got the same error so activeperl is off the hook. "list" should be: $thr->list() The perldocs

RE: threads package missing is_running

2008-05-02 Thread Brian Raven
ose less the is_running issue. All I really need is some > way to determine if the thread is still running even if it's checking > if the process id exists. When it is, I want to SIGUSR1 the thread. > > 'threads' is a standard module, so I have no clue why it'

RE: threads package missing is_running

2008-05-02 Thread webmaster
f the thread is still running even if it's checking if the process id exists. When it is, I want to SIGUSR1 the thread. 'threads' is a standard module, so I have no clue why it's having amnesia. The module is found at C:/Perl/lib/threads.pm and not part of the ppm. Here is a sho

Re: threads package missing is_running

2008-05-02 Thread Lyle - CosmicPerl.com Support
[EMAIL PROTECTED] wrote: > Yes, the threads module comes pre-packaged with ActivePerl, and does not > appear to exist according to PPM, so it's not upgradable without upgrading > ActivePerl, which involves me dealing with company red-tape. > Think you'll need to

Re: threads package missing is_running

2008-05-02 Thread Lyle - CosmicPerl.com Support
[EMAIL PROTECTED] wrote: > Hi All, > > I'm attempting to use the 'threads' module in ActivePerl 5.8.0 build > 805. Everything seems to work until I attempt to shut the process down > gracefully. When I call is_running() the whole thing crashes with the > followi

Re: threads package missing is_running

2008-05-02 Thread webmaster
Yes, the threads module comes pre-packaged with ActivePerl, and does not appear to exist according to PPM, so it's not upgradable without upgrading ActivePerl, which involves me dealing with company red-tape. The elusive "is_running.al" shouldn't need to exist outside of the

RE: threads package missing is_running

2008-05-02 Thread Brian Raven
[EMAIL PROTECTED] <> wrote: > Hi All, > > I'm attempting to use the 'threads' module in ActivePerl 5.8.0 build > 805. > Everything seems to work until I attempt to shut the process down > gracefully. When I call is_running() the whole thing crashes w

threads package missing is_running

2008-05-02 Thread webmaster
Hi All, I'm attempting to use the 'threads' module in ActivePerl 5.8.0 build 805. Everything seems to work until I attempt to shut the process down gracefully. When I call is_running() the whole thing crashes with the following output (main thread starts the shutdown a

Re: threads and blessed objects...

2008-02-22 Thread Mike Gillis
Wayne Simmons wrote: > Hi all. I'm working on a serious perl threaded project, and I'm trying to > use Threads::Queue to pass data between my threads, and now it is telling me > that I can't use them to pass objects (that is blessed scalars). > > Why is that? D

Re: threads and blessed objects...

2008-02-21 Thread Foo JH
I'm not spent more time on this same issue than I should, but you need to know a few things about threading and Perl: 1. Threads::Queue takes in only scalars 2. If the scalar is a ref to an object instance, you need to share() it first 3. share()ing is not deep, so you will have to ensure y

threads and blessed objects...

2008-02-21 Thread Wayne Simmons
Hi all. I'm working on a serious perl threaded project, and I'm trying to use Threads::Queue to pass data between my threads, and now it is telling me that I can't use them to pass objects (that is blessed scalars). Why is that? And what can I do about it? The exact error I g

threads module update

2007-01-10 Thread Roode, Eric
The latest AS perl core bundle, which seems to be ActivePerl 5.8.8.819, has version 1.31 of threads.pm. I need to use features that were introduced in version 1.34 (the current is version 1.57). But I don't have a C compiler. When I ask ppm ("ppm search threads"), it gives me i

Re: Behavior of threads on XP-- system() works, backtic & popen d on't ...

2006-06-15 Thread Doyle, Keith
a streamlined version of the test program as contributed on the perlmonks site with some minor modifications by me: #! perl -slw use strict; use threads; sub test { my $t = shift; my $cmd = "c:/windows/system32/sort.exe test$t.dat"; # kludge to insure all t

Behavior of threads on XP-- system() works, backtic & popen don't ...

2006-06-12 Thread Doyle, Keith
Am running ActiveState perl v5.8.7 on Windows XP Pro. Tried the following test script. The idea here is to run two parallel threads that process a common queue of todo items. The processing however, requires running some external executables. Had first tried the backtic as I'd like to ge

Re: Threads?

2006-04-16 Thread Foo JH
Daniel Rychlik wrote: I just found out that threads are indeed expensive... Even if my loop sleeps for 2 minutes thread count continues to increment... How do you destroy a thread when you know that its job is done? This is a 2K machine running the latest active perl. I am using My suspicion

Re: Threads?

2006-04-16 Thread Foo JH
$thread1->detach(); $thread2->detach(); # Sleep 10 seconds and check the que again for any other data. Sleep(10); You may be facing an incremental number of threads that spawn every 10 sec. Better to join the threads than to detach them, THEN do the

RE: Threads?

2006-04-14 Thread Jan Dubois
you sure it ever returns? For example the code that you typed in earlier shows you starting new threads every 10 seconds if there are files in your QUEUE directory. But since you didn't guarantee that the previous files had been removed, you could be starting multiple threads trying to proces

RE: Threads?

2006-04-14 Thread Daniel Rychlik
ECTED] Sent: Friday, April 14, 2006 9:58 AM To: Daniel Rychlik; activeperl@listserv.ActiveState.com Subject: RE: Threads? > How do you destroy a thread when you know that its job is done? In my experiences, threads automatically terminate when it's commands are finished. I've never had

RE: Threads?

2006-04-14 Thread Chris O
> How do you destroy a thread when you know that its job is done? In my experiences, threads automatically terminate when it's commands are finished. I've never had on hang unless it is waiting on something. - Chris ___ ActivePerl

RE: Threads?

2006-04-14 Thread Daniel Rychlik
I agree they should destroy themselves and clean up after them after they are done... This is frustrating. If I had known this I would have started this project with JAVA... Threads are so easy to do in JAVA. You give them a list of instructions; they do their jobs asynchronously or

Re: Threads?

2006-04-14 Thread $Bill Luebkert
Daniel Rychlik wrote: > I just found out that threads are indeed expensive... Even if my loop > sleeps for 2 minutes thread count continues to increment... How do you > destroy a thread when you know that its job is done? Let me preface by saying I don't use threads, but you wo

RE: Threads?

2006-04-14 Thread Daniel Rychlik
I just found out that threads are indeed expensive... Even if my loop sleeps for 2 minutes thread count continues to increment... How do you destroy a thread when you know that its job is done? This is a 2K machine running the latest active perl. I am using ithreads. -Dan -Original

RE: Threads?

2006-04-13 Thread Brian Raven
Daniel Rychlik <> wrote: > Thank you for the information... I have that part working now > however Ive hit another road block... > > I have 3 threads that do different things with different files. > Those routines are separated in my program. When I go and grad all >

RE: Threads?

2006-04-12 Thread Daniel Rychlik
Thank you for the information... I have that part working now however Ive hit another road block... I have 3 threads that do different things with different files. Those routines are separated in my program. When I go and grad all of the files that need processing, I then spawn the threads

Re: Threads?

2006-04-11 Thread $Bill Luebkert
Foo Ji-Haw wrote: > Qualifier (from doc): it counts only non-joined, non-detached threads. The list function - but if you keep track of the threads you create and their joinedness and detachedness :), you don't need anything else including the list function. Just add some bookkeeping.

Re: Threads?

2006-04-11 Thread Foo Ji-Haw
Qualifier (from doc): it counts only non-joined, non-detached threads. $Bill Luebkert wrote: Daniel Rychlik wrote: Hello, I’m curious is to how you get a thread count from perl threads… Surely there has to be a way… I would think you would keep track of them as you create them

Re: Threads?

2006-04-11 Thread $Bill Luebkert
Daniel Rychlik wrote: > Hello, > > I’m curious is to how you get a thread count from perl threads… > > Surely there has to be a way… I would think you would keep track of them as you create them. Couldn't you just use threads->list() ? my @ret = threads->list

Threads?

2006-04-11 Thread Daniel Rychlik
Hello,   I’m curious is to how you get a thread count from perl threads…    Surely there has to be a way…    -Dan     ___ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com

Re: Qn on classes, inheritance, and threads

2006-03-29 Thread Williamawalters
> {> my $pFunc;> eval '$pFunc = \&'.ref($this).'::doThat';> return threads->new($pFunc,$this);> }> > package DerivedClass;> ...> sub doThat> {> ...> }> > Essentially, the 3 lines of code does the following:>

RE: Qn on classes, inheritance, and threads

2006-03-29 Thread Brian Raven
Foo Ji-Haw <> wrote: > Hey William, > > Ok, I've dug around, and I've got a working solution to my problem. > It's a bit ugly though: > > package BaseClass; > ... > sub doThis > { > my $pFunc; > eval '$pFunc = \&

Re: Qn on classes, inheritance, and threads

2006-03-28 Thread Foo Ji-Haw
Hey William, Ok, I've dug around, and I've got a working solution to my problem. It's a bit ugly though: package BaseClass; ... sub doThis { my $pFunc; eval '$pFunc = \&'.ref($this).'::doThat'; return threads->new($pFunc,$this

Re: Qn on classes, inheritance, and threads

2006-03-28 Thread Foo Ji-Haw
Hello William, Thanks for the tip. In your example you did this: threads->create(\&DerivedClass::doThat,$this); And it seems to work. But if I am to make the 'DerivedClass' portion dynamic (as it has to work with other subclasses eg DerivedClass2, DerivedClass3), how can I

Re: Qn on classes, inheritance, and threads

2006-03-28 Thread Williamawalters
In a message dated 3/28/2006 5:50:21 A.M. Eastern Standard Time, [EMAIL PROTECTED] writes:   > Hi all,> > I have a need to do this (abstracted from the attached working code):> package BaseClass;> use threads;> > sub doThis> {> my $this = shift;> >   

Qn on classes, inheritance, and threads

2006-03-28 Thread Foo Ji-Haw
Hi all, I have a need to do this (abstracted from the attached working code): package BaseClass; use threads; sub doThis { my $this = shift; threads->create(\&doThat,$this); } package DerivedClass; use base 'BaseClass'; sub new { my $class = shift; my $this = $

Qn on classes, inheritance, and threads

2006-03-28 Thread Foo Ji-Haw
Hi all, I have a need to do this: package BaseClass; use threads; sub doThis { my $this = shift; threads->create(\doThat,$this); } package DerivedClass; use base 'BaseClass'; sub new { my $class = shift; my $this = $class->SUPER::new; return bless $this,$clas

RE: Threads

2006-02-27 Thread Brian Raven
Sandeep Deshpande <> wrote: > Dear All, > Very recently our sys. Administrator upgraded our Perl v5.8.6. to > 5.8.8. > This version is failing to run all our programs based on > threads/Threads. It gives following message. > >

Threads

2006-02-27 Thread Sandeep Deshpande
Dear All, Very recently our sys. Administrator upgraded our Perl v5.8.6. to 5.8.8. This version is failing to run all our programs based on threads/Threads. It gives following message. - Message -- This Perl hasn&#

RE: Threads in Perl

2006-01-19 Thread Brian Raven
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pravin Talegaonkar Sent: 19 January 2006 11:36 To: activeperl@listserv.ActiveState.com Subject: Threads in Perl > Dear Gurus, > > I need to use threads in Perl. I have following requirement. I need to process few files a

Threads in Perl

2006-01-19 Thread Pravin Talegaonkar
Title: Threads in Perl Dear Gurus, I need to use threads in Perl. I have following requirement. I need to process few files at a given time, I used to use following approach 1) Get the names of all the files in Array 2) Process all the files one by one. This was a simple one, but it

activeperl + mysql + threads = crash

2005-07-22 Thread Foo Ji-Haw
Hi all, I thought I can hit a nice milestone today, but it seems that I have hit a strange obstacle instead. In my tests, the following code will run, but when it terminates an error message will be shown. use strict; use warnings; use DBI; use threads; doIt(); doIt(); sub doIt { my $dbh

Re: threads blocking output on windows

2004-11-15 Thread Mathieu Longtin
My guess is it's a function of the language. If I write an equivalent program in python, the behavior on windows is totally ordered, unlike perl. So my guess is there is a problem with perl's thread implementation in windows. I've also noticed that if I start a thread in a perl program that is qui

Re: threads blocking output on windows

2004-11-13 Thread John W. Kennedy
$Bill Luebkert wrote: > Mathieu Longtin wrote: >>STDERR is unbuffered by default (that's why I used it), and > Supposed to be. Remember this is not UNIX. I don't assume. And remember that it's not a function of the operating system anyway, but of the language. (In this case, both Perl and the C

Re: threads blocking output on windows

2004-11-12 Thread $Bill Luebkert
Mathieu Longtin wrote: > STDERR is unbuffered by default (that's why I used it), and Supposed to be. Remember this is not UNIX. I don't assume. > apparently the threads are executing when they're supposed > to, just not printing as they go. Also remember that you'

Re: threads blocking output on windows

2004-11-12 Thread Mathieu Longtin
STDERR is unbuffered by default (that's why I used it), and apparently the threads are executing when they're supposed to, just not printing as they go. --- $Bill Luebkert <[EMAIL PROTECTED]> wrote: > A couple of things to try. 1) Try opening a file for > append in > e

Re: threads blocking output on windows

2004-11-11 Thread $Bill Luebkert
Mathieu Longtin wrote: > I'm trying to use threads, but it seems threads are > blocking the output on windows. > > I've included a sample program. It starts two threads, and > then three threads proceed to print the time elapsed since > the beginning of the proce

threads blocking output on windows

2004-11-11 Thread Mathieu Longtin
I'm trying to use threads, but it seems threads are blocking the output on windows. I've included a sample program. It starts two threads, and then three threads proceed to print the time elapsed since the beginning of the process. On Windows, the two thread print all their output

RE: TK and threads (with join) problem

2004-01-09 Thread Wayne Simmons
I experienced this I think you need to create your TK GUI AFTER you create your threads. I'm not really sure why but when one of those threads ends, it's trying to kill your main window, as if the object was shared (even though I know you didn't specify that it should be). Some

TK and threads (with join) problem

2004-01-09 Thread Hale, Bruce E
Has anyone successfully been able to use Perl/TK and threads at the same time? I have run into a problem where I can run threads but if I use thread->join then I run across problems with respect to program termination in one case (shown below) or where the thread hash list gets fouled up (m

Threads

2003-12-13 Thread wjnorth
   if ($hostcheck == 1) {         $thread = threads->new(\&scanning); # Spawn the thread     $thread->detach;     } else {    

RE: Threads and Perlapp

2003-03-07 Thread Scott Campbell
: Threads and Perlapp On 7 Mar 2003 at 15:17, Scott Campbell wrote: > I am unable to compile (with perlapp) a script using the "Threads" > module. > Has anyone else been able to compile it? > I am using ActivePerl 5.8, and PerlApp 5.xxx. > > Compile Time Error: > -

RE: threads - cancelling a blocking IO call

2003-02-05 Thread Beau E. Cox
Hi again - > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Robert > Friberg > Sent: Wednesday, February 05, 2003 12:50 AM > To: Beau E. Cox; [EMAIL PROTECTED] > Subject: SV: threads - cancelling a blocking IO call > > &

SV: threads - cancelling a blocking IO call

2003-02-05 Thread Robert Friberg
gt; Från: Beau E. Cox [mailto:[EMAIL PROTECTED]] > Skickat: den 5 februari 2003 06:04 > Till: Robert Friberg; [EMAIL PROTECTED] > Ämne: RE: threads - cancelling a blocking IO call > > > Hi Robert - > > > -Original Message- > > From: [EMAIL PROTECTED] > &g

Re: Pipes and threads?

2003-02-03 Thread Jenda Krynicky
From: Hudson T Clark <[EMAIL PROTECTED]> > Is it possiable to get two pipes working between two threads? or a > thread and the main proccess? Yes. The problem is that under Windows the select() (the four parameter form!) works only on socket()s :-((( Therefore you'll

RE: Pipes and threads?

2003-01-31 Thread Beau E. Cox
Hi Hudson - > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Hudson T > Clark > Sent: Monday, April 07, 2003 11:09 PM > To: [EMAIL PROTECTED] > Subject: Pipes and threads? > > > Is it possiable to get two pipes wor

RE: Problem with Threads

2003-01-24 Thread Beau E. Cox
Hi - > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Steve > Slaughter > Sent: Thursday, January 23, 2003 9:25 AM > To: [EMAIL PROTECTED] > Subject: Problem with Threads > > > I am setting up threads to process an arr

Re: Win32::OLE and threads

2003-01-07 Thread Jenda Krynicky
From: "Dave Crawford" <[EMAIL PROTECTED]> > Jenda, Sorry about the confusing question, I was confused myself and > thought you were an AS employee. No I'm not :-) And I don't know when will Jan be in the office. Jenda = [EMAIL PROTECTED] === http://Jenda.Krynicky.cz = W

Re: Objects and threads

2002-12-13 Thread jjore
quot;Gerrit Hoppen" <[EMAIL PROTECTED]>         cc:                 Subject:        Re: Objects and threads > perlthrtut: > The biggest difference between Perl ithreads and the old 5.005 style threading, or for that matter, to most other threading systems out there, is that by default, no da

Re: 5.8 Beta and threads

2002-11-24 Thread Jan Dubois
On Sun, 24 Nov 2002 08:35:01 -0500, "Dave Crawford" <[EMAIL PROTECTED]> wrote: >These are the log results with the code as is below: > >ShutdownIO() >A thread exited while 2 other threads were still running. > >You'll notice that the DLL object is

5.8 Beta and threads

2002-11-24 Thread Dave Crawford
is closing it calls ShutdownIO() This is where I set the shared variable $running to '0' so that the child will exit it's while() loop and allow the thread to close. 4) VB app destroys ActiveX control object These are the log results with the code as is below: ShutdownIO()

Re: Error while using Threads ON WIN NT..

2001-07-03 Thread Jenda Krynicky
ot;; > } > > IF i run this code ..It gives me error below.. > ERROR : > This perl was built for "ithreads", which currently does not support > Thread.pm. Run "perldoc Thread" for more information at th.pl line 4. Did you run perldoc Thread? Thread is an old obsole

Error while using Threads ON WIN NT..

2001-07-03 Thread gopal
Hi, I want to use thread in perl on windows NT. My code is not working.. If anybody knows about this let me know.. use Thread; $thr = new Thread \&sub1,"A","B"; sub sub1 { my @inparameter = @_; print "@inpparameter \n"; } IF i run this code ..It gives me error below.. ERROR : This perl w

threads

2001-03-15 Thread bill stennett
Hi all forgive me - I think this may have mentioned recently but.. Can anyone give the definitive answer about threads in the Win32 activestate port of PERL. I am looking at perl 5.6 build 623. When I try a simple example which tries to use threads I get the message: "No th

threads in activeperl

2001-03-12 Thread Václav Haisman
Hi, I am confused by threads in activeperl. I have installed Perl from ActivePerl-5.6.0.616-MSWin32-x86-multi-thread.msi. One could think it supports threads, but when I try this simple test: use Thread; sub proc {    print "proc\n";} my $t = new Thread \&proc