On Thu, 17 Dec 1998, Asger K. Alstrup Nielsen wrote:

> > The subject says it all. Am I the only one who sees that when the
> > lyxserver is on, LyX chews CPU like a mad cow?
> 
> The pipe-handling is done via XForms, so if there is a performance
> problem, it's a problem in XForms.

I suspect the real problem is that Jean-Marc's lyx server is waiting for a
command to be finished (i.e. a '\n').

> 
> I think it might differ from system to system.  On some systems, XForms
> might be doing busy waiting...

It has to.  It has to handle input both from an event queue and from file
descriptors simultaneously and -- from the user perspective --
asynchronously.  There is most likely a non-blocking select() next to an
XPeekEvent() or similar in the event loop in xforms.  As it can't know in
advance from which source the next data will appear on, it can't block on
any and has to poll on both of them continously ==> busy wait.

> 
> If we handle the pipes ourselves, we might be able to improve this,
> but since the LyXServer is disabled by default, I don't think it's
> much of a problem, at least not for 1.0.

We would even have to bypass Xlib.  On the lowest level, LyX is reading
from a file descriptor representing the message stream (i.e. a file
descriptor) from the X server; the select() had to go there (and block).
(in plain English: "forget it" =)



Joacim
-
With both feet on the ground, you won't get very far.
                -- Loesje
ä

Reply via email to