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. > >>> # Asynchronously join threads. >>> $threads = threads->list(); >> >> Note tha

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 that $threads contains a single thread objec

RE: threads package missing is_running (solvedish)

2008-05-06 Thread Brian Raven
[EMAIL PROTECTED] wrote: > I thought about the locking approach, but this will all eventually be > wrapped into a Windows services tool that will shutdown the service > gracefully. I don't see how that removes the need for locking when changing shared variables? > >

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
I thought about the locking approach, but this will all eventually be wrapped into a Windows services tool that will shutdown the service gracefully. The way services work, the process needs to ping the service control manager once in a while when it is still running. So, if a thread didn't shutd

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 show no is_running method

RE: threads package missing is_running

2008-05-02 Thread Brian Raven
[EMAIL PROTECTED] wrote: > I'd love it if I could just upgrade perl, but corporate bureaucracy > sucks and the new versions need approval for security purposes. I > initially tried it with 5.6.1 with less success, and 5.8.0 seems to > be very close less the is_running is

RE: threads package missing is_running

2008-05-02 Thread webmaster
I'd love it if I could just upgrade perl, but corporate bureaucracy sucks and the new versions need approval for security purposes. I initially tried it with 5.6.1 with less success, and 5.8.0 seems to be very close less the is_running issue. All I really need is some way to determine if the thre

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 upgrade. > The elusive "is_runnin

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 > following output (main thread starts the s

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 module itself. It's a

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 with > the following output (main thread starts

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? Different interpreters (that is, di

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 you're

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 i

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 sleep. ___

RE: Threads?

2006-04-14 Thread Jan Dubois
On Fri, 14 Apr 2006, Daniel Rychlik wrote: > Perhaps Im missing something then... May be a return status in the > last step of the function. No, a detached thread should just be cleaned up when it returns. But you still haven't shown any code for your thread function. What makes you sure it ever

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 mailing list ActivePe

RE: Threads?

2006-04-14 Thread Daniel Rychlik
--Original Message- From: $Bill Luebkert [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 9:36 AM To: Daniel Rychlik Cc: activeperl@listserv.ActiveState.com Subject: Re: Threads? Daniel Rychlik wrote: > I just found out that threads are indeed expensive... Even if my loop > slee

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 would think that whe

RE: Threads?

2006-04-14 Thread Daniel Rychlik
Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of $Bill Luebkert Sent: Tuesday, April 11, 2006 11:01 PM To: activeperl@listserv.ActiveState.com Subject: Re: Threads? Foo Ji-Haw wrote: > Qualifier (from doc): it counts only non-joined, non-detached threads. The list funct

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 > of the files that need pro

RE: Threads?

2006-04-12 Thread Daniel Rychlik
t I should do differently? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of $Bill Luebkert Sent: Tuesday, April 11, 2006 11:01 PM To: activeperl@listserv.ActiveState.com Subject: Re: Threads? Foo Ji-Haw wrote: > Qualifier (from doc): it counts onl

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. > $Bill L

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(); print scalar @ret, "\n";

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. > > - > Message

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 at a given ti

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 not dealing with the UNIX

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 > each thread and write your o

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 process. > > On Windows, the two threa

RE: Threads and Perlapp

2003-03-07 Thread Scott Campbell
That was it! Thank you. Scott Campbell Senior Software Developer Somix Technologies http://www.somix.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 3:22 PM To: [EMAIL PROTECTED]; Scott Campbell Cc: [EMAIL PROTECTED] Subject: Re

RE: threads - cancelling a blocking IO call

2003-02-05 Thread Beau E. Cox
Online > #------- > > > -Ursprungligt meddelande- > > Från: Beau E. Cox [mailto:[EMAIL PROTECTED]] > > Skickat: den 5 februari 2003 06:04 > > Till: Robert Friberg; [EMAIL PROTECTED] > > Ämne: RE: threads - cancell