The patch deals with the beginning stage, transferring data
from fricas to view2/3D, that code deals with the ending stage,
writing data from view2/3D to disk.

Also the problem raised by "THEMOS" is mitigated by the "Fix" part.

But!!!  The mitigation was invalided by my "OBEY"->"|run_program|"
change.  Because |waitForViewport| uses a lowercase "obey" and
I missed it.

I was going to submit the following patch anyway.
There is a "sleep" to prevent spawning lots of processes.

- Qian

diff --git a/src/interp/util.lisp b/src/interp/util.lisp
index a3da8695..6f1ee95f 100644
--- a/src/interp/util.lisp
+++ b/src/interp/util.lisp
@@ -372,11 +372,11 @@ After this function is called the image is clean and can be saved.
 (defun |waitForViewport| ()
   (progn
    (do ()
-       ((not (zerop (obey
+       ((not (zerop (|run_shell_command|
         (concat
          "ps "
          |$ViewportProcessToWatch|
-         " > /dev/null")))))
+         " > /dev/null && sleep 0.05")))))
        ())
    (|sockSendInt| |$MenuServer| 1)
    (|setIOindex| (- |$IOindex| 3))


On 4/20/24 18:28, Ralf Hemmecke wrote:
Maybe this comment is connected to the sleep stuff...

https://github.com/fricas/fricas/blob/master/src/hyper/htinp.c#L351

==============
THEMOS says: There is a problem here in that we issue the (|close|) and
then go on. If this is the last command, we will soon send a SIGTERM and
the whole thing will collapse maybe BEFORE the writing out has finished.
Fix: Call a Lisp function that checks (with \spadop{key} ps and grep) the health of the viewport. We do this after the (|close|).
==============

Ralf


--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/6fd18a14-bcc5-4a11-a6e9-a9621b2d724f%40gmail.com.

Reply via email to