
25 Apr
2010
25 Apr
'10
2:45 p.m.
The problem could be in your use of forkIO. To quote the documentation of forkOS [1]:
Like forkIO, this sparks off a new thread to run the IO computation passed as the first argument, and returns the ThreadId of the newly created thread. However, forkOS creates a bound thread, which is necessary if you need to call foreign (non-Haskell) libraries that make use of thread-local state, such as OpenGL (see Control.Concurrent).
So you have to make sure that all calls to OpenGL originate from a bound thread and furthermore that all calls to OpenGL originate from _the same_ thread. Regards, Roel 1 - http://hackage.haskell.org/packages/archive/base/4.2.0.1/doc/html/Control-Co...