Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

new gawkextlib select extension supports I/O multiplexing and cooperative (synchronous) signal trapping

49 views
Skip to first unread message

Andrew Schorr

unread,
Mar 29, 2015, 9:44:03 AM3/29/15
to
The gawk master branch has added support for two new features. As per the NEWS file:

11. Gawk now supports retryable I/O via PROCINFO[input-file, "RETRY"]; see
the manual.

12. The API minor version has been increased to two; the get_file()
API provides access to open redirections. Also see the manual.

With these changes, it is now possible to have I/O multiplexing in gawk using select. If this is of interest, please download gawk here:

git clone git://git.savannah.gnu.org/gawk.git

You can then build the new gawkextlib select extension which provides a select function, non-blocking I/O, and some signal trapping capabilities. You can download it here:

https://sourceforge.net/projects/gawkextlib/files/

Please refer to the bundled man page, test cases, and examples to see how it works. The select extension has been tested on Linux and Cygwin. Testing on other platforms would be much appreciated. Comments, criticisms and feedback are welcome.

With these building blocks in place, it should now be possible to build a socket library and a GUI toolkit for gawk. One could also implement a poll interface in a similar fashion to select, if that's of interest.

Even if I/O multiplexing is not interesting to you, note that the new retryable I/O support enhances the value of the read timeout mechanism. For an example, you can look at the test/timeout.awk code in the gawk master branch.

Regards,
Andy

tny_...@yahoo.com

unread,
Mar 31, 2015, 3:51:15 AM3/31/15
to
Thank you very much for your efforts!
- Tony

Andrew Schorr

unread,
Mar 31, 2015, 9:43:51 PM3/31/15
to
On Tuesday, March 31, 2015 at 3:51:15 AM UTC-4, tny_...@yahoo.com wrote:
> Thank you very much for your efforts!

You're welcome. I'm really hoping for feedback about the API. If it has flaws, it would be great to get them fixed as soon as possible. And testing on other platforms would also be tremendously helpful.

Best,
Andy
0 new messages