[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim-dev
Subject:    Re: [vimdev] Re: Vim's future ?
From:       "Charles E. Campbell" <cec () gryphon ! gsfc ! nasa ! gov>
Date:       2002-11-06 14:54:07
[Download RAW message or body]

On Wed, Nov 06, 2002 at 11:30:17AM +0100, Philippe FREMY wrote:
> > I don't really understand what you mean with "blocking" here.  Every GUI
> > normally handles one event at a time.  Vim does the same thing: waits
> > for a character, does something, then waits for the next.  
> 
> The problem, which you seem to be aware of, is that all GUI have an event
> loop. They receive events (mouse move, focus, key pressed), they pass it to
> the application and expect the application to return, so that they can fetch
> the next event.
> 
> Vim doesn't have an event loop. It takes one character in one place, then
> (almost) blocks until the next character is entered (it then does not return
> to the gui). There is a timer that calls a function to tell the gui to
> process some events, put them in the vim queue and return.
 ---------------------------------------------------------------------

Seems to me that usually systems sporting guis support threads in some
fashion.  How about a thread to handle mouse moves/gui-interactions with
one thread where the rest of Vim occupies another thread.  Wire
key-presses into a queue which the "gui-thread" feeds during otherwise
blocked times to the vim thread, which continues to "think" it has
normal keypress access.

This solution seems sufficiently obvious that there must be reasons
against it.  I am not an expert at the vim loops, but I am a bit
familiar with them as I looked at them somewhat when I was doing
sockets interfacing (which Bram turned down in favor of the current
X stuff).

Regards,
C Campbell

-- 
        Charles E Campbell, Jr, PhD            _   __   __
        Goddard Space Flight Center           / /_/\_\_/ /
        cec@NgrOyphSon.gPsfAc.nMasa.gov      /_/  \/_//_/
  PGP public key: http://www.erols.com/astronaut/pgp.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic