help-smalltalk
[Top][All Lists]
Advanced

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

[Help-smalltalk] committed reorganization of Win32 event handling


From: Paolo Bonzini
Subject: [Help-smalltalk] committed reorganization of Win32 event handling
Date: Wed, 26 Aug 2009 09:34:49 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3

I finally finished the reorganization of sysdep code I started last weekend:

1) last weekend I separated the sysdep code into various pieces in the sysdep/ directory, organized by "topic" and OS, and duplicated events.c (previously considered non-system-dependent, but actually relying heavily on POSIX features) into sysdep/posix/events.c and sysdep/win32/events.c.

2) now I rewrote sysdep/win32/events.c to use native Win32 APIs; so I was also able to figure out the common parts, and move them back to libgst/events.c.

The Win32 code is still not very commented and not very readable; the approach is totally different from POSIX because it signals Smalltalk semaphores from a separate thread rather than from signal handlers. In the future, however, this may turn out to be the way to go even for POSIX (via libevent)!

While I wrote the code independently, after the fact I noticed that putty uses the same approach. This cannot be bad.

3) at the same time, sockets became a bit more intertwined with the event handling machinery, so I moved socket code into the main DLL. You will still have to load the Sockets.star package (it's just the C module that is no more).

The good news are threefolded. First, the POSIX code sees just functions moving around; the actually code is basically untouched. This is good for stability. Second, some very ugly code for Win32 (the emulation of poll, and signalx.*) goes away: the net effect is like -600 lines of code. Third, despite extremely light testing, it is less buggy than before---at least "Sockets.Socket microTest" works.

Besides including VisualGST, I think we're now feature-complete for 3.2.

Paolo




reply via email to

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