[HOpenGL] RE: HOpenGL and --enable-threaded-rts

Sven Panne Sven_Panne@BetaResearch.de
Mon, 17 Jun 2002 11:29:15 +0200


Simon Peyton-Jones wrote:
> [...] Is there no way to get the "current context" explicitly, and
> treat it as some kind of "handle" that accompanies GLUT calls?

I fear this is no solution to a general problem: Most APIs out there will
probably break miserably if their callbacks are executed by a thread
different from the one doing the registration and/or initialization of
the API. Not nice, but thread-safe APIs are not very common.   :-(

I don't have a good solution at hand, perhaps we could extend 'foreign
import "wrapper"' by an annotation "execute callbacks in the same thread
as the current one"? Ugly...

Cheers,
   S.