Re: select() in dynamically-linked code
Martin Gasbichler <[email protected]>
| Newsgroups | gmane.lisp.scheme.scsh |
|---|---|
| Message-ID | <[email protected]> |
Michel Schinz <[email protected]> writes: > Martin Gasbichler <[email protected]> writes: > >> Michel Schinz <[email protected]> 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? Well, first that would require two syscalls for every FFI call which seems rather expensive. Second, I think C code should really be prepared for incoming signals, SIGCHLD for example may also happen at any time if you start processes. -- Martin