octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #55648] [MXE-Octave] cannot print with gnuplot


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #55648] [MXE-Octave] cannot print with gnuplot graphics toolkit
Date: Tue, 12 Feb 2019 02:55:05 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0

Follow-up Comment #18, bug #55648 (project octave):

Thanks, Dan, for the suggestion. It probably is better than what we have at
the moment. But I don't think it would solve the issue at hand.
I'll try to better describe what is going on:
1. __gnuplot_get_var__ is called and a command is sent to gnuplot via fputs.
Let's call this "thread A" (it's not different threads but I don't know a
better word).
2. It waits for an answer and eventually calls "pause" which causes the
callback queue to be flushed (implicit "drawnow").
3. A callback from the queue ("thread B") calls __gnuplot_get_var__ and sends
a command to gnuplot via fputs.
4. For the sake of simplicity assume that this thread isn't interrupted again.
So at a certain point it receives an answer from gnuplot. But that answer
corresponds to the command send by "thread A" earlier. Since there are no
further checks, in continuation this answer will be interpreted as if it
corresponded to the command from "thread B".
5. Eventually the queue returns to "thread A" where an answer from gnuplot
will be received. But that answer is to the latter command send from "thread
B".

Maybe we could use persistent variables to collect and assign answers from
different "threads". But if it is possible that fread could return early, that
could get messy quite fast.

It would be easier (and cleaner imho) if the "pause" between fputs and fread
could be avoided altogether. However, I don't how often __gnuplot_get_var__ is
called and if that could lead to some kind of blocking.

I don't think that the real culprit is in drawnow but it really is the use of
"pause" in __gnuplot_getvar__. Maybe a change might the issue occur more
frequently. But this was always waiting to happen at some point.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55648>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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