3b/cl-opengl

OSX threading stuff needs work

3b opened this issue · 8 comments

3b commented

OSX requires GL/GLUT stuff to be done from initial thread.

CCL uses first thread internally by default, so need to rearrange threads there.

SBCL should work if cl-opengl is loaded before slime, or slime isn't using :spawn communication style

not sure about other lisps...

FYI, I've started working on this issue. Feedback would be welcome, particularly regarding the general feasibility of the approach of interrupting the initial thread to run the main loop.

080d001199adae17056a takes your feedback into account and adds a few more cleanups. Next step is to port this to bordeaux-threads which might require augmenting it with some interface to get the initial-thread. Any objections to depending on bordeaux-threads on darwin?

Has there been any progress on this?

epeld commented

For what it's worth, I could run all the examples fine on OSX (with SBCL) using this:
https://github.com/Shinmera/trivial-main-thread
to ensure I call display-window from the main thread.

@epeld Nice. Want to submit a pull request using that on OS X?

epeld commented

@luismbo Sure, I will give it a shot but it might take a while. I'm new to lisp and haven't even been able to figure out how to load the project from its .asd-files yet..

@epeld heh, that's OK. How are you loading it now?

epeld commented

@luismbo I was using quicklisp and just editing the source that emacs brought me to after M-.. But I figured that wouldn't work once I forked the repo..

This is what I did anyway: epeld@1532421