This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Guile/GL/GLUT and POSIX threads trick (any hope?).


Jim Blandy <jimb@red-bean.com> writes:

> I would guess that only one thread can be allowed to be in GLUT at a
> time, right?  Why don't you create a glut_mutex which a thread must
> hold while it makes GLUT calls?  Leave the rest of Guile
> multi-threaded.

Well, it's worse than that.  GLUT has a glutMainLoop that must be
called before glut starts doing anything, and it never returns.  So I
can't see any safe way, with or without posix threads, to have a REPL
in the terminal window, and have GLUT call guile functions from its
callbacks...

Someone on the opengl list showed me that if you're willing to compile
your own version of GLUT you can make things work right by rolling
your own glutMainLoopIteration() function.  It's trivial, and it
apparently works, but of course, it's non-portable.

Thanks

-- 
Rob Browning <rlb@cs.utexas.edu> PGP=E80E0D04F521A094 532B97F5D64E3930

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]