Just to make sure I have understood everything correctly: To make
HOpenGL work in the presence of a threaded RTS, the only places which
need a change are the stub factories for GLUT callbacks, where a "bound"
attribute is required now.
Correct.
What about the foreign import of glutMainLoop (the main native dispatcher
for GLUT, which calls the Haskell callbacks mentioned above when an event
occurs and blocks the rest of the time)? It is currently "safe", is this
OK? Or should it be "threadsafe"?
It should probably be "threadsafe", just in case somebody wants to do some (non-OpenGL) work in the background.
I must admit that I can't remember the exact semantic distinction between those two attributes anymore... :-}
The problem is, nobody does... the original implementation didn't work in all cases. The original implementation made "safe" calls block all other haskell threads in some cases, and crashed in other cases. "Threadsafe" means that calling the foreign import shouldn't block or otherwise disturb other haskell threads. "Safe" means... well... almost nobody seems to know, and still fewer people agree on it.
In the current "HEAD", there is no difference between threadsafe and safe. If someone comes up with a clear specification of why and how "safe" should be different from threadsafe, things might change again.
This issue is (I think/hope) entirely orthogonal to the Bound Threads proposal.
Cheers,
Wolfgang
_______________________________________________ FFI mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/ffi