Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Unix Question

Re: Unix Question

From: Shawn Ferris <shawn_at_virtualsmf.net>
Date: Wed, 26 May 2004 14:14:15 -0600 (MDT)
Message-ID: <29521.168.215.22.23.1085602455.squirrel@mail.virtualsmf.net>


> 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



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US