Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Queuing in multithread context

by Hardin (Novice)
on Jan 20, 2015 at 11:28 UTC ( [id://1113861]=note: print w/replies, xml ) Need Help??


in reply to Re: Queuing in multithread context
in thread Queuing in multithread context

Hi!

Thanks for taking time to answer, sorry if I didn't make myself clear, my aim is to achieve queueing of my sub "deployRoutine" so that each copy task is executed after another and not sent alltogether.

I have two main loops, the first loop through "targets" (ie: server where I need to copy files/directories) and the second embbeded is to loop through "deployments" which are several separated copy tasks.

Lets say I have 3 servers : srv1, srv2 & srv3, I need to copy on each of those some remote content to local contents: copy1, copy2 & copy3 with

  • copy1: source=\\some\remote\content1 dest=C:/some/local/content1
  • copy2: soure=\\some\different\remoteconte dest=C:/another/local/destination
  • copy3: ... (you get the idea)

I want the copy tasks (I said 3 but that could be 4, 5 or more, this can vary) sent to each servers one after another while currently they are sent at the same time since I create the thread its directly executed to the server.

Right now I'm trying to understand your code as it's bit unclear to me.

Cheers :)

Replies are listed 'Best First'.
Re^3: Queuing in multithread context
by BrowserUk (Patriarch) on Jan 20, 2015 at 11:33 UTC
    my aim is to achieve queueing of my sub "deployRoutine" so that each copy task is executed after another and not sent alltogether.

    If you want to execute the subroutines sequentially; don't use threads!

    Just call the subroutine from within your loop; and they'll execute sequentially with no conflicts. Simples!


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1113861]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-25 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found