David Thornley <email@example.com> wrote:
| Rob Warnock <firstname.lastname@example.org> wrote:
| >It's not that simple, since you almost certainly want (for example)
| >the "select()" system call to properly interact with any threading
| >that's built into your CL, and *that's* not likely to be a "small
| >matter of FFI".
| Is it any simpler with C? That's the point I'm addressing.
| I don't see that CL has any disadvantage relative to C in
| APIs that can't be corrected by a bit of fiddling with FFI.
The point was that the *system* (Common Lisp, Scheme, Python, whatever)
probably already has some internally-defined way of handling the
interactions between threads and I/O so as to make thread-local
blocking I/O actually be *non*-blocking in the application as a
whole. The question is whether those facilities have been exposed
to the FFI facility in such a way that you the user can write FFI-based
extensions that "play nice" with those internally-defined non-blocking
I/O facilities. (Without having to go digging around in the source code
of the Lisp system... which you might very well not have available!)
| How is this done in C? It's got to be a problem no matter which
| language you're working in.
It's not so much a language issue per se, as an application system
issue. For example, if you're trying to write an X Windows application
that also does socket reads/write to some other server (say, a database)
and you don't want mouse events to be locked out while you're waiting
for a remote server response, you're going to have to "play nice" with
the X event loop. [Now fortunately, the Xt Intrisics provide this nice
little "XtAddInput(unix_fd, reason, function, data)" that you can use.]
But you get the idea. In any Lisp system you want to be able to add
FFI-based I/O stuff to, you're going to need to find out the equivalent
of "XtAddInput()" for that system's thread/non-blocking-I/O management,
and use that in your FFI code.
Rob Warnock, 31-2-510 <email@example.com>
SGI Network Engineering <http://reality.sgi.com/rpw3/> [until 8/15]
1600 Amphitheatre Pkwy. Phone: 650-933-1673
Mountain View, CA 94043 PP-ASEL-IA
[Note: firstname.lastname@example.org and email@example.com aren't for humans ]