bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Adding an API hook to enable a select extension


From: Andrew J. Schorr
Subject: Re: [bug-gawk] Adding an API hook to enable a select extension
Date: Fri, 31 May 2013 10:33:13 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, May 31, 2013 at 05:17:43PM +0300, Eli Zaretskii wrote:
> > In other words, I think it makes sense to use the extension capability
> > to provide the well-known select mechanism.
> 
> It is well known to C programmers, but not necessarily to Awk
> programmers.

This is the beauty of extension libraries.  If you want to use C-style
select, then the library will be there.  If you don't like it, then don't
use it.  It will not be part of the core language.

> > I note that read timeouts do not work on MinGw and VMS because select is
> > apparently not available, or so it appears from the code in 
> > io.c:read_with_timeout.
> 
> For Windows, that's not true: one can write 'select' for Windows that
> will work for files and devices as well.  It just takes more work,
> because the version of 'select' provided by the OS only works for
> sockets.  You can see an example of that in gnulib.

Thanks.  If we get close to committing this, then I guess we should
explore how to make it work under MinGw.  Have you looked at what code
changes would be necessary to get the read_timeout feature to work
in MinGW?

> > Is there some alternative event dispatching mechanism that works on these
> > platforms?
> 
> Apart of the facilities to peek at input from non-socket handles,
> which can be used to provide Posix-style 'select', Windows provides
> many other mechanisms.  Posix platforms, likewise, provide them.  How
> about asynchronous I/O, for example?  Why wouldn't that be a better
> facility for Gawk?

By all means, let's have more extensions to provide different ways
of multiplexing I/O.  I am volunteering to try to implement a simple select
capability, but I welcome others to step up and provide other libraries
that may better suit their needs.  We should add the minimal set of API
hooks to enable these features, and then people can do whatever they
like in the extension libraries.

Regards,
Andy



reply via email to

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