Question: Running a command in separate thread
Submitted by gchii on Tue, 08/19/2008 - 15:08.
How do I invoke a command--so that it runs in a separate thread?
Is this like Linux?
grep import > ggg.txt &
Thanks,
- Login to post comments
Default behaviour
Commands are executed in a separate thread by default but they block the console while running.
You can unblock the console with Ctr-Z but the command keeps running in the background.
At the moment I don't know of a way for starting up a command in the background.
You might want to create a feature request for this.
The problem with supporting '&'...
... is that JNode currently has no reliable way of killing a command. In the old days, the shell tried to use Thread.kill(), but the only thing that was good for was making the kernel panic. Even if it did work, Thread.kill is a dodgy way of doing things; check out the reasons that Sun deprecated it!
Support for job control functionality (background, foreground, stop, continue, kill) in the shell / interpreter is on hold until we have an isolate-based command invoker working.