[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #56600] 'system' commnad returns pid for async

From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #56600] 'system' commnad returns pid for async process, not on Matlab
Date: Tue, 9 Jul 2019 19:39:26 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #5, bug #56600 (project octave):

There are a couple of different paths through the system command.  For the one
when output is requested and you are on a Unixy system, you end up forking and
executing something like

/bin/sh -c "sleep 5 &"

in the child process.  The parent is connected to the stdout from this command
using a pipe and tries to read.  It seems like that is blocking, even when the
command should be executed in the background.

Maybe there is something simple that we can do, like waiting to see whether
the child exits "immediately" (seems like asking for race condition problems
to me)?  Or maybe a whole different implementation of system is needed to
correctly handle this kind of command consistently for Windows and Unix

What does Matlab do for system commands?  Are they always executed with the
native system command interpreter?  On Windows, is command.exe used to execute

Is Matlab expecting the command interpreter (either /bin/sh or command.exe) to
execute the full "foo &" command, or is Matlab parsing the command to see
whether it ends with "&" and then doing something special to execute as a
background process?

How compatible do we want to be here?

I'm not sure how best to fix this, but these are some issues to think about if
anyone is interested.


Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]