callbacks
Lex Spoon
lex at cc.gatech.edu
Sun Jun 23 16:03:12 UTC 2002
Andreas,
Thanks for the additional thoughts. Maybe aiming a little lower would
be helpful? The needs of a graphics toolkit like GTK are used in
limited ways. If one only supports enough to talk to GTK:
1. You don't need to generate your own C functions to deal with
callbacks -- you can write the redirectors as C functions in the plugin.
2. The threading is simplified. The main Squeak thread will be blocked
by a call to a primitive that calls some sort of gtk_mainloop()
function. Thus the thread that handles callbacks will not be
interrupting the main thread at a weird location, and it will also be
safe from being starved by the main thread.
Also, nested callbacks won't happen so long as you are using just *one*
of these libraries, and it is set up like GTK. So you can ignore
out-of-order returns to begin with, and still do some cool experiments.
It would be very nice to do it all using FFI straight in the image and
not write a line of C code. But requiring juts a bit of glue code to be
written can simplify things to something managable, it seems.
Lex
More information about the Squeak-dev
mailing list
|