Martin Gasbichler <gasbichl@informatik.uni-tuebingen.de> writes:
> Michel Schinz <Michel.Schinz@epfl.ch> writes:
[...]
>> If yes, is there a solution, or are all libraries which use select()
>> (or any signal stuff, I presume) fundamentally incompatible with scsh?
>
> You could block signals using sigprocmask() before calling the C
> function.
Ok, I'll look into that. Just a question, though: why doesn't scsh
(well, I guess it's more Scheme 48, but anyway) disable its timer
interrupt during calls to C functions, and re-enable it on return? It
seems to me that these signals which keep on coming can cause
problems, as in my case, and aren't needed at all while the C code is
running. Am I missing something?
> However one fundamental problem remains: If you call a C function that
> takes a very long time to execute, the whole scshvm is blocked for
> that time.
Yeah, I had thought about this, and my aim in the mid-term is to
switch to curl's "multi" interface, which is not as easy to use as the
"easy" one, but which doesn't block during the whole transfer. Maybe
simply switching to this interface will solve my whole problem, in
fact, but I wanted to start with the easy interface and have something
running before going further.
[...]
> We're also thinking about providing some way to start operating
> system threads to handle C function calls that may block forever but
> we didn't implement anything yet.
That's nice to know.
Anyway, thanks a lot for your precious help, this should keep me
going!
Michel.
|