Yes, but how do I load the libraries in the initial OS thread if sbcl is running under a different thread as with slime or swank ?
Sent from my iPad
On Aug 15, 2010, at 3:19 AM, Nikodemus Siivola <nikodemus@...> wrote:
> On 11 August 2010 18:03, Kevin Smith <k2msmith@...> wrote:
>> Sorry if I asked this already, but is there any way to insure foreign
>> libraries are loaded on the initial thread for sbcl built with threads ?
>> There is a problem with certain MAC OSX libraries (in 10.6, snow leopard)
>> in this regard (like OpenGL, for example). They can only be loaded in
>> initial thread or cause breakpoint exceptions otherwise. Maybe sbcl already
>> takes care of this ?
> No, unfortunately there isn't a convenient mechanism to automatically
> do this for all foreign libraries.
> Options available:
> * If an application, just take care to load all foreign code in the
> initial thread.
> * If a library, document the need to be loaded in the initial thread.
> (And make sure you're not doing any lazy loading!)
> That said, there is one option that you _could_ use, but which is
> really bad and I STRONGLY recommend against it. Grab a reference to
> the initial thread and use INTERRUPT-THREAD to call LOAD-SHARED-OBJECT
> there. Don't do this, really.
> Apropos, can you post a snippet of code that shows how to provoke the error?
> -- Nikodemus