Running external command in sequential order
Cameron Laird
claird at starbase.neosoft.com
Tue Mar 27 10:59:16 EST 2001
In article <985684788.135533.1517.nullmailer at ev.netlab.zetabits.com>,
Yukihiro Matsumoto <matz at zetabits.com> wrote:
>HI,
>
>In message "[ruby-talk:13231] Running external command in sequential order"
> on 01/03/27, Paul Pladijs <ppladijs at cage.rug.ac.be> writes:
>
>|The system method of the Kernel module creates a subshell,
>|starts the requested command (= parameter of system method).
>|After creating the subshell, the following statements of
>|the ruby script are executed. So, after invoking the system
>|method, two processes (the ruby interpreter and the subshell)
>|are running in parallel, at least in a multitasking
>|environnement. (I hope this is correct)
>
>system function in Ruby waits the process to terminate. So it's just
>like system2 you desired.
>
> matz.
Mr. Pladijs has been asking this in at least a couple of
newsgroups. I'll attempt a bit of clarification. I hope
I dispel, not increase, the muddiness.
Mr. Pladijs, your comments on the parallel action of
system are NOT correct for Ruby and Python (or Tcl or
Perl or ...). The basic external-command-invocation in
each of these libraries is sequential and synchronous, as
what you labeled "system2" in your original post.
You expressed a desire to minimize process count. This is
a commendable instinct. However, I recommend that you first
model your application in working code. If you still have a
concern about minimization of processes, yes, there are ways
to achieve that. I think you'll be in a more informed posi-
tion to discuss them after you've deepened your experience
of conventional uses of library facilities.
--
Cameron Laird <claird at NeoSoft.com>
Business: http://www.Phaseit.net
Personal: http://starbase.neosoft.com/~claird/home.html
More information about the Python-list
mailing list