[plt-scheme] SQLID, FFI and OS threads
At Thu, 11 Jan 2007 22:23:15 +0100, Hans Oesterholt-Dijkema wrote:
> The drivers of SQLID start an OS thread to execute
> SQL, in order to keep mzscheme from blocking. Suppose
> I'd rewrite the drivers using the FFI, how could a similar
> behaviour be achieved?
Good question.
My first thought was: use `get-ffi-obj' to obtain the OS's
thread-starting function, and then call that. However, the function
that you pass to the OS-thread-starting function would be a Scheme
function --- which must not run in a different OS thread. So that idea
doesn't work.
It seems like the function you pass to the thread-starting function
should be minimal, and maybe it could be constructed by some lego-like,
function-building blocks provided by the FFI. But I don't know whether
that idea would really work, and the FII doesn't provide any such
blocks at the moment.
Anyone else have an idea?
Matthew