Creating cores without a toplevel fun

"J. Gareth Williams" <[email protected]> Thu, 27 Nov 2025 21:38:31 -0500
Newsgroups gmane.lisp.steel-bank.general
Message-ID <CALfqwAp_UUDsDQh_Jq79vDDudZL=968MqCwu-DGShEUQ9kMSVA@mail.gmail.com>
Hi SBCL folks,

I'm playing around with creating SBCL cores, mostly to use in conjunction
with libsbcl.so, so they don't have toplevel functions -- they're generally
intended to provide functionality to be called from C.

I wrote a trivial `main()` that does `initialize_lisp()` and on return, I
can successfully call my callable-exports.  All good.

But one of my callable exports wants to approximate the behaviour of
invoking SBCL "natively", and naively calls `#'TOPLEVEL-INIT`, but that
seems not to work -- it hangs on a futex.  I think it's waiting on another
thread -- which I have not explicitly created,

I notice that when I run plain SBCL out of the box, I have just one thread
once it reaches the user REPL, whereas in my scheme, I seem to have *two*
threads when I return from `initialize_lisp()`:

(#<SB-THREAD:THREAD tid=1350105 "main thread" RUNNING {1201BF8003}>
 #<SB-THREAD:FOREIGN-THREAD tid=1350105 "callback" RUNNING {1201C58023}>)

Why does this happen?  Is it created *because* there is no toplevel?  What
does it do?  Can I safely ignore it?

Thanks in advance,
Gareth

_______________________________________________
Sbcl-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-help