in reply to Synchronous action

What is the underlying reason to copy at the same time?
If the purpose is to cut down on run time because it's a huge amount of data, use fork().
If it is a matter of concurrent synchronisation, you will need some kind of locking mechanism.

Replies are listed 'Best First'.
Re^2: Synchronous action
by kingjamesid (Acolyte) on May 12, 2011 at 17:18 UTC
    Maybe I used wrong terminology. Not to make it complicated, I just wanted all robocopy to be started at teh same time from one source to multilple machines. PARALLEL. It saves time. If done in SERIAL, it takes a long time for the robocopy to finish. I shall research on FORK, meanwhile, I hope you get my idea, what am trying to do and using "synchronization" might have confused you all. oops.

      All you need is:

      for my $client ( @clients ) { ## Note: the '1' first parameter to system ## which means that the command will be executed asynchronously system 1, qq[ robocopy $srcmachine $client ]; }

      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".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        Can you explain what this does? Instead of calling robocopy at the same line, I would like to copy a function with two arguments, src and dest. meaning like this.
        system 1, &startCopy( $srcMachine $client->[0]);
        But (in eclipse), its giving me a syntax error. Any suggestions on this?