Re: executing batch of command after thread call



On 24 Aug 2005 19:53:41 -0700, "omurice" <ckwiguno@xxxxxxxxx> wrote or
quoted :

>In my code, I call a thread
>and then just below the call to the thread there are some other command
>which I need to execute just after the call to the thread finishes,...
>But now because I'm using a thread, the batch of command gets executed
>first...
>Is there any way I can do to get the batch executed after the thread???

If the last thing you do in your run method is an exec or a
ProcessBuilder.start then the spawn won't happen until everything else
is done.

If the first thing you do in your run method is an exec or a
ProcessBuilder.start then the spawned process will execute in parallel
with your thread code, unless you program in a wait.

See http://mindprod.com/jgloss/exec.html

Java code is always more eloquent than English. Post code if you want
people to unambiguously understand what you are asking.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
.



Relevant Pages

  • Re: Sleep freezing
    ... >> man exec. ... > form of a standard shell pipeline where each arg becomes one ... > word of a command, and each distinct command becomes a sub- ... The word "execute" means to replace the program running in the calling ...
    (comp.unix.shell)
  • [Full-Disclosure] Advanced usage of system() function.
    ... and call its arguments as a command for shell. ... as we can see we still didnt get what we want (typing exit ... Connection closed by foreign host. ... think what we want to execute. ...
    (Full-Disclosure)
  • Advanced usage of system() function.
    ... and call its arguments as a command for shell. ... as we can see we still didnt get what we want (typing exit we are ... Connection closed by foreign host. ... think what we want to execute. ...
    (Bugtraq)
  • Re: du command failing
    ... directory if the directory does not have a Read or Execute permission. ... From UNIX command line i have executed 'du' command. ... From [exec] manpage: ...
    (comp.lang.tcl)
  • Re: Wait for background processes to complete
    ... To be able to execute commands in the background and wait for their ... The documentation I am referring to is http://perldoc.perl.org/. ... You can run a command in the background with: ... There is a general problem with perl documentation: ...
    (comp.lang.perl.misc)