Re: Hang in embedded libchicken

Diogo via <[email protected]>
Newsgroups gmane.lisp.scheme.chicken
Message-ID <[email protected]>
On Sun, Feb 16, 2025 at 03:22:57PM +0100, [email protected] wrote:
>
> You are doing nothing wrong, it is just a limitation of the runtime system.
> CHICKEN expects callbacks to be invoked in the same thread as the
> one that invoked CHICKEN_run()/CHICKEN_initialize(). During
> initialization, stack-limits are inferred to ensure the generational
> garbage collector sees when the nursery is exhausted. Different
> thread have of course wildly different stack addresses, so this
> will confuse the garbage collector. You could say that this is a severe
> shortcoming (not necessarily a bug), and we could try to set the limits on
> every external call-in into the runtime system.

Ok, that makes a lot of sense now.
 
> There is an egg ("concurrent-native-callbacks") that addresses
> this very issue (calling from multiple threads into compiled
> CHICKEN code). It is not as elegant or clean as calling from
> multiple threads directly, but it is at least one possible approach.

I'll take a look at this egg, thank you!

-Diogo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.