[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Texmacs-dev] One more patch to cut&paste
From: |
Norbert Nemec |
Subject: |
Re: [Texmacs-dev] One more patch to cut&paste |
Date: |
Thu, 11 Jun 2009 23:37:23 +0100 |
User-agent: |
Thunderbird 2.0.0.21 (X11/20090409) |
Josef Weidendorfer wrote:
Hi,
On Thursday 11 June 2009, Norbert Nemec wrote:
Also, I am not fully content with the idling loop that is running to
catch socket communications.
Just a comment here: busy polling (on sockets, for timers, ...)
in user space never should be needed.
I fully agree. In Qt alone, this is simple to avoid.
However, TeXmacs splits the GUI details into a "plugin" that follows a
certain interface. That way, one can use X11, Qt and other widget sets.
The interface for that GUI is homegrown and rather minimalistic.
Any clean solution that involves the event loop has to be implemented in
the GUI in some way, so in the case of socket-IO, you not only have to
think how to implement this in Qt, but how to define a interface for
this functionality such that other GUI plugins can also offer the same
functionality.
It is certainly possible, but needs some serious restructuring.
On Unix, the select() system call allows to wait for arbitrary file
descriptors to become ready, including sockets, and has a timeout to
allow for the implementation of timers. I am quite sure that Qt
internally uses this.
To wait on sockets in Qt (data to read available, error condition, ...)
with the standard event loop (thus, without polling), use QSocketNotifier.
And any "texmacs internal timers" should be based on QTimer.
Josef