Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Unix Question
> The problem that Ryan has comes from trying to solve it with the wrong
> tool
.. snip .. snip ..
> Multithreading with threads communicating with each other is
> something that should be done by specialized scripting languages.
So.. if it can be done via korn shell.. does that promote it to a specialized scripting language? This is very rudimentary, but should suffice for the task at hand. Mladen is mostly correct, but IPC is a sledge hammer if all that you want to do is fork some processes and figure out their exit status. ksh can do this fine. 8D
Take this example:
#!/bin/ksh
( sleep 5; exit 2 ) &
p1=$!
( sleep 3; exit 1 ) &
p2=$!
( sleep 1; exit 0 ) &
p3=$!
wait $p2; echo "p2:$?" wait $p1; echo "p1:$?" wait $p3; echo "p3:$?"
This works for this example. But as Mladen suggests, Korn isn't the best of tools for this. YMMV
Shawn
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Wed May 26 2004 - 15:02:33 CDT
![]() |
![]() |