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
(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
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
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
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.
[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
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
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
>
# 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
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'
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
[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
[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
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
[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
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
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
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
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
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
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
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
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
$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
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
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
> 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
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
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
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
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
>
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
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.
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
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
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
>
{> 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:>
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 = \&
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
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
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;> >
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 = $
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
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.
>
>
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
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
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
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
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
$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
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'
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
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
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
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
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
if ($hostcheck == 1) {
$thread = threads->new(\&scanning); # Spawn the thread
$thread->detach;
} else {
: 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:
> -
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
>
>
&
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
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
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
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
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
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
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
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()
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
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
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
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
71 matches
Mail list logo