Need help with perl script using threads.

R

r_stringer66

Hello,

I am trying to write a perl script which will executes three other perl
scripts simultanously such as the example described below:

I will have a main.pl script which will call test1.pl, test2.pl and
test3.pl simoultanously in a multithreaded fashion.


If anyone could show me how to do that in perl given the example I just
described I would very much appreciate it.

Regards,
Rob
 
R

r_stringer66

Thanks for your quick response.

I did try your suggesion but this solutions seems to run all three
scripts sequentially,

test2.pl only got executed after test1.pl finished. I was actually
looking for a way to run all three of them concurrently , forcing each
of them to spawn a new thread simultanously.

Thanks in advance for any ideas you might have on this,

Regards,
Rob
 
A

A. Sinan Unur

(e-mail address removed) wrote in @g43g2000cwa.googlegroups.com:
Thanks for your quick response.

Whose response?
I did try your suggesion

Whose suggestion?

Please quote some context when you respond.

This is especially important in this case because the aptly named
ignoramus has set X-No-Archive, and therefore future readers of this
thread will not be able to locate his answer to which you are
responding.
but this solutions seems to run all three scripts sequentially,

His "solution" had nothing to do with "threads".

system( "test1.pl \&; test2.pl \&; test3.pl \&" );

This is an operating system dependent call. Roughly speaking, on a *nix
system, it will execute all three scripts in the background. On Windows,
it will execute each script in turn.
test2.pl only got executed after test1.pl finished. I was actually
looking for a way to run all three of them concurrently , forcing each
of them to spawn a new thread simultanously.

It looks like you are on Windows system.
Thanks in advance for any ideas you might have on this,

Please read the posting guidelines for this group. Follow the
recommendations given there to formulate your question in Perl, and post
again.

Sinan
 
R

r_stringer66

Hi Sinan,

Since my post was a reply to Ignoramus's post, I assumed that it was
clear whose suggestion I was refereing to.

Secondly you are asking me to post my message again, I don't honestly
understand why , I belive that the problem as I describe it is very
clear.

I am just trying to run three perl scripts concurrently on a windows
system, I am not sure how this question is not adhereing to the posting
guidelines of this group.

Please advise.

Regards,
Rob
 
A

A. Sinan Unur

(e-mail address removed) wrote in @z14g2000cwz.googlegroups.com:
Since my post was a reply to Ignoramus's post, I assumed that it was
clear whose suggestion I was refereing to.

Again, you snippped all context when responding, showing that you did
not bother to read my response:
....

Secondly you are asking me to post my message again, I don't honestly
understand why , I belive that the problem as I describe it is very
clear.

It is not clear, because you have shown no Perl code. So all we have to
go on are assumptions on what you might mean by the word threads.
I am just trying to run three perl scripts concurrently on a windows
system,

Since you do not have any Perl code, I am assuming the statement above
is referring to operating system specific functionality for invoking
programs, and therefore off-topic.
I am not sure how this question is not adhereing to the
posting guidelines of this group.

If you want to use threads in Perl, then read the documentation, write
Perl code, and ask if you have trouble.

Sinan
 
R

r_stringer66

First of all I did not snip the context when i press reply everhting is
blank to begin with.

Second of all I don't think that there is a hard iron rule that
dictates that a) I have to formulate my message by including the
original context and b) that I have to put in code.

Obviously Ignoramus has been able to provide me with answers to all my
questions without seeing any code therefore making perl code not
necessarly.

And also I never said that I wanted to use threads I said that I wanted
to execute all three scripts simultanously in a multithreaded fashion.
And again Ignorasmus' last post only confirms that one does not have to
use explicit perl thread in order to achieve that.

And finally I think you are the one who does not bother reading my post
carefully and it is very presumptious of you to imply that I did not do
any research on my own before I asked the question and it is ironic
that you complain about my posts yet you fail to provide any solutions.

In any event I don't have the time to get into a discussion with you as
of how I should post my messages. So far all my questions have been
answered , for which I am very thankful btw, and that by itself is
confirmation enough for me that i am posting my questions in a correct
manner.

Regards,
Rob
 
J

Jürgen Exner

I am trying to write a perl script which will executes three other
perl scripts simultanously such as the example described below:

Did you check "perldoc Thread"?

jue
 
J

Jürgen Exner

First of all I did not snip the context when i press reply everhting
is blank to begin with.

Then learn how to use your Newsreader.
Not quoting _any_ context is even worse than full-quote.
Second of all I don't think that there is a hard iron rule that
dictates that a) I have to formulate my message by including the
original context and b) that I have to put in code.

Depends upon if you want people to read your article or not. It's your
choice.
Obviously Ignoramus has been able to provide me with answers to all my
questions without seeing any code therefore making perl code not
necessarly.

Hmmm, if that's true and considering the name of this NG I guess you may
have posted in the wrong NG to begin with.
And also I never said that I wanted to use threads

Oh, really? Then I wonder who wrote the "subject"....

[...]
ironic that you complain about my posts yet you fail to provide any
solutions.

Who is that "you"? You are not providing any context, therefore we cannot
know who "you" is.
In any event I don't have the time to get into a discussion with you
as of how I should post my messages. So far all my questions have
been answered , for which I am very thankful btw, and that by itself
is confirmation enough for me that i am posting my questions in a
correct manner.

Oh, I see....
Well, so long then

jue
 
R

r_stringer66

Then learn how to use your Newsreader.
Not quoting _any_ context is even worse than full-quote.

Thanks Juergen , thanks to you I just learned.

Depends upon if you want people to read your article or not. It's your
choice.

People did actually respond therefore they must have read them, don't
you think?

Hmmm, if that's true and considering the name of this NG I guess you may
have posted in the wrong NG to begin with.

Really? The name of this group isnt' comp.lang.code.perl.misc is it?
Oh, really? Then I wonder who wrote the "subject"....

I agree the subject was a little misleading but the content of it was
pretty clear, there is something called context , consider it , people
who have actual answers do.

Who is that "you"? You are not providing any context, therefore we cannot
know who "you" is.

Just look whose post I did reply to , again context, does solve a lot
of mystery.

I honestly think a lot of people have a lot of time on their hands to
post with such petty complaints and funny enough it is usually people
who dont have the answers. Again if you dont like my post , just don't
answer it

Happy posting :)
Rob
 
G

Gunnar Hjalmarsson

Jürgen Exner said:
Then learn how to use your Newsreader.

Which newsreader?

Message-ID: <[email protected]>
--------------------------------------------------^^^^^^^^^^^^^^^^

OTOH, it sure seems as if Google Groups by default includes the message
that is being replied to...

:(
 
R

r_stringer66

Igonrasmus,

First of all let me thank you again for all your input.

I do agree that putting in more detail and context in the message will
make it easier for people to respond.

I just reall felt that my question didn't really have much to do with
the actual code rather than how to call the individual scripts no
matter what they contained.

the only reason I got defensive is because this is the first group
where I was sort of attacked in this manner to which I take great
offence because I never have this experience in other groups to which I
have posted numours questions.

I believe however in constructive criticism and therefore I wil make a
greater effort to be more concise.

Thanks again,
Rob
 
C

Chris Mattern

Hi Sinan,

Since my post was a reply to Ignoramus's post, I assumed that it was
clear whose suggestion I was refereing to.

You are assuming that everybody can *see* Ignoramus's post. Not
a safe assumption on Usenet. Since Ignoramus for some unknown
reason uses X-No-Archive, in fact a very large people will *not*
see Ignoramus's post, and will *never* see his post.
Secondly you are asking me to post my message again, I don't honestly
understand why , I belive that the problem as I describe it is very
clear.

No. A code example is clear. Paraphrasing what you are doing is
not clear. This group will not write your code for you. The group
*will* help you fix your code. For that, the group needs to *see*
your code.
I am just trying to run three perl scripts concurrently on a windows
system, I am not sure how this question is not adhereing to the posting
guidelines of this group.

Perhaps if you read the guidelines, you'd know. Since you've already
failed to follow them twice, I can only assume you haven't.
Please advise.

Regards,
Rob

--
Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
 
R

r_stringer66

Try replacing

test1.pl \&

with

start c:\\path\\to\\perl.exe test1.pl

which will execute them in separate DOS windows, but simultaneously.

i

Hi Ignoramus ( hope I got it right this time :))

I actually followed your suggestion above my line in my main.pl looks
like this:

system ( c:\\path\\to\\perl.exe test1.pl ; c:\\path\\to\\perl.exe
test2.pl; c:\\path\\to\\perl.exe test3.pl);

But it looks like only test1.pl is being executed.

Is there anything I am missing?

Thanks
Rob
 
A

A. Sinan Unur

(e-mail address removed) wrote in
First of all I did not snip the context when i press reply everhting
is blank to begin with.

This, after snipping all context once again where I nicely explain why
it is important not to do that:
In any event I don't have the time to get into a discussion with you
as of how I should post my messages. So far all my questions have
been answered , for which I am very thankful btw, and that by itself
is confirmation enough for me that i am posting my questions in a
correct manner.

Well, *PLONK*
 
R

r_stringer66

Sinan,

I snipped the context once again, but let me spell out to you what I
mean to say by this post.

GET A LIFE!!!!!!
 
T

Tad McClellan

First of all I did not snip the context


Who said that you _did_ snip the context?

(Since you didn't quote what you are commenting on, we cannot tell
what you are commenting on. It goes round and round and round...
)

when i press reply everhting is
blank to begin with.


I had noticed that effect last week, when it seemed to me
that we were suddenly awash in no-context followups.

Scoring started at -1000 when postings started from google,
which is where all domains that provide a WWW posting
interface go as soon as I identify them as such.

That only lasted a few weeks until I changed upped it to -5000,
due to Google's horrid reformating of code.

This no-quoting scourge encouraged me to modify it yet again:

% wasteland domains
Score:: -9000
Organization: http://groups.google.com
From: aol\.com
From: msn\.com
[snip lesser-used domains]


I am afraid that their choice of default is hurting their users
chances of getting questions answered.


I see a strident dichotomy:

Google rocks! Coming up with a better way of indexing was
brilliant, these guys are like Programming rock stars!

Google rocks again! Look at that homepage!
No flash, only substance.

Google cluster rocks! Enough Linux boxes to melt the polar ice
cap, awesome dude!

Google rocks The Street! Boy howdy what an IPO!

Google Groups rocks! (for searching) It is my very 1st bookmark,
even ahead of regular Google (which is 2nd).

Google Groups sucks a big one with unsightly bumps on it!
(for posting) because it encourages quoting nothing.

I am depressed that the rock stars are slipping away to drugs
(figuratively speaking), I hope they can kick it and return to sanity.

I think allowing posting from GG has been a very bad business
decision by Google (the only bad one that I'm aware of). It
has hurt their reputation more than the increased advertising
hits are worth IMO.

Second of all I don't think that there is a hard iron rule that
dictates that a) I have to formulate my message by including the
original context and b) that I have to put in code.


You are correct.

If you want many of the frequent-answerers to see your questions,
then it *is* a pretty hard rule, as most answerers will just move
on to help somebody else instead.

It is only a "rule" if you really want to get the most generous
and knowledgeable people to look at your question.

And also I never said that I wanted to use threads


Hnuh?

Does Google even fill in the Subject: headers for you?

Subject: Need help with perl script using threads.

You didn't say that?


(I smell an XY problem...)

it is very presumptious of you to imply that I did not do
any research on my own before I asked the question


No it isn't. Have you been lurking here for some time and are
speaking from first-hand experience?

No? Then who is being presumptious in telling us How It Should Be?

There are a great many posts here that are of the "gimme gimme"
variety, I don't know how you missed seeing at least some of them.

So, it is presumptious so assume that attempts _have_ been made
when there is no code presented to confirm that work has been done.

In any event I don't have the time to get into a discussion with you as
of how I should post my messages.


Me either, so I'll make one more edit to my newsreader's config file:

Score:: -9998
From: (e-mail address removed)


So long!

So far all my questions have been
answered , for which I am very thankful btw, and that by itself is
confirmation enough for me that i am posting my questions in a correct
manner.


So then, you are saying that your attitude is one of "the ends justify
the means" ?

I think somebody's "gimme gimme" detector is working just fine.
 
R

r_stringer66

I refer you to post number 12 of this thread in which I answered most
of your now somewhat dated points.

I don't think you read most the complete thread otherwise you wouldn't
go off repeating points other people made already.

Either way you sound like one of the people who miss the bigger picture
and love to hear yourself talk. I think all the rules and guideline
have limited your ability to understand a simple post for which only a
double digit IQ will suffice.
(sounds you me like the trees are covering the forest).

I am not sure if you an authority on this site or not, but you can save
your intimidative approach eitherway. I have the outmost disregard for
people who without even considering the real problem always will quote
you rules and guidelines even if those do not really address the
original problem.

And it sounds to me if my "gimme gimme" radar is working certainly your
"me me me" one is working as well.


Tad said:
First of all I did not snip the context


Who said that you _did_ snip the context?

(Since you didn't quote what you are commenting on, we cannot tell
what you are commenting on. It goes round and round and round...
)

when i press reply everhting is
blank to begin with.


I had noticed that effect last week, when it seemed to me
that we were suddenly awash in no-context followups.

Scoring started at -1000 when postings started from google,
which is where all domains that provide a WWW posting
interface go as soon as I identify them as such.

That only lasted a few weeks until I changed upped it to -5000,
due to Google's horrid reformating of code.

This no-quoting scourge encouraged me to modify it yet again:

% wasteland domains
Score:: -9000
Organization: http://groups.google.com
From: aol\.com
From: msn\.com
[snip lesser-used domains]


I am afraid that their choice of default is hurting their users
chances of getting questions answered.


I see a strident dichotomy:

Google rocks! Coming up with a better way of indexing was
brilliant, these guys are like Programming rock stars!

Google rocks again! Look at that homepage!
No flash, only substance.

Google cluster rocks! Enough Linux boxes to melt the polar ice
cap, awesome dude!

Google rocks The Street! Boy howdy what an IPO!

Google Groups rocks! (for searching) It is my very 1st bookmark,
even ahead of regular Google (which is 2nd).

Google Groups sucks a big one with unsightly bumps on it!
(for posting) because it encourages quoting nothing.

I am depressed that the rock stars are slipping away to drugs
(figuratively speaking), I hope they can kick it and return to sanity.

I think allowing posting from GG has been a very bad business
decision by Google (the only bad one that I'm aware of). It
has hurt their reputation more than the increased advertising
hits are worth IMO.

Second of all I don't think that there is a hard iron rule that
dictates that a) I have to formulate my message by including the
original context and b) that I have to put in code.


You are correct.

If you want many of the frequent-answerers to see your questions,
then it *is* a pretty hard rule, as most answerers will just move
on to help somebody else instead.

It is only a "rule" if you really want to get the most generous
and knowledgeable people to look at your question.

And also I never said that I wanted to use threads


Hnuh?

Does Google even fill in the Subject: headers for you?

Subject: Need help with perl script using threads.

You didn't say that?


(I smell an XY problem...)

it is very presumptious of you to imply that I did not do
any research on my own before I asked the question


No it isn't. Have you been lurking here for some time and are
speaking from first-hand experience?

No? Then who is being presumptious in telling us How It Should Be?

There are a great many posts here that are of the "gimme gimme"
variety, I don't know how you missed seeing at least some of them.

So, it is presumptious so assume that attempts _have_ been made
when there is no code presented to confirm that work has been done.

In any event I don't have the time to get into a discussion with you as
of how I should post my messages.


Me either, so I'll make one more edit to my newsreader's config file:

Score:: -9998
From: (e-mail address removed)


So long!

So far all my questions have been
answered , for which I am very thankful btw, and that by itself is
confirmation enough for me that i am posting my questions in a correct
manner.


So then, you are saying that your attitude is one of "the ends justify
the means" ?

I think somebody's "gimme gimme" detector is working just fine.
 
J

Jürgen Exner

I refer you to post number 12 of this thread

Newsgroups articles are numbered? That's certainly news to me.
Where can I find that omimous post number 12?

jue
 
R

r_stringer66

Wow and you are a regular newsgroups user? Look at the thread tree on
the left frame , as you can see the posts of the thread are numbered.
See it yet or do you need some more "context" or some "perl code" to
clarify , after all the guidelines state that that is neccessary.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,771
Messages
2,569,587
Members
45,099
Latest member
AmbrosePri
Top