|
From: Jan N. <jan...@gm...> - 2016-12-05 10:15:01
|
2016-12-05 10:56 GMT+01:00 Gustaf Neumann:
> Is there a good reason for Tcl to support multiple native
> event handling interfaces rather than moving towards an
> abstraction library? A good candidate is libuv [1],
> which is the hottest "successor" of libev due to its
> windows support (IOCP) ... and probably due to its
> usage in nde.js. libuv uses kqueue, (e)poll, IOCP,
> eventfd, etc. where possible; .... and it is based on
> a MIT-style license.
>
> By using such a library, there is a hope to reduce the number
> of separate source code variants and ifdefs in the Tcl code base
> and reduce maintenance costs.
Honestly, libuv looks good to me. But it doesn more than
only handling the event loop, all (asynchronous) I/O is
expected to be handled by it as well. So it will be more
a rewrite than only replacing the notifier.
So, I would expect the following steps. Currently there
are 3 Notifiers:
- Unix
- Windows
- MacosX
The current proposal adds 2 more, together with configuration
options so select a proper one for each platform.
So, well, let's add one more, based on libuv, and see how
it performs compared to the other options. If this works
out well, then the other ones can be removed for Tcl 9.0,
and we are all happy. ;-)
Noting about the ifsdef's: the UNIX notifier has some special
ifdef's for Cygwin, so that it can handle both Windows and
UNIX events. I don't think libuv implements that! It allows
Cygwin Wish to be able to work in 2 modes: It can connect
to an X11 server anywhere (as on UNIX), and it can display
directly on screen using the Win32 API without the need for an X-server.
Therefore, until this capability is built into the other notifiers,
I would like to keep the SELECT notifier as default in Cygwin.
Regards,
Jan Nijtmans
|