[Haskell-cafe] STM interfacing with GLFW

Pavel Krajcevski krajcevski at gmail.com
Sat Dec 7 21:35:32 UTC 2013


Hi,

I'm new to STM and to Haskell in general. I've been writing a small library
to try some graphics algorithms in Haskell, but using GLFW's callbacks
seems to be causing me problems. I have a (relatively heavyweight?) object
wrapped in a TVar (Data.Set) that I'm sharing across all threads.

Unfortunately, once I run the program, it becomes unresponsive although the
main loop is still running. I'm not sure exactly what the semantics are for
getting STM right, but ideally I'm trying to modify the TVar in GLFW event
callbacks and then finally read out the value of the TVar at the end (or
beginning) of my rendering loop. I've been able to get a small program
working that reproduces my problem:

https://gist.github.com/Mokosha/34eda7bd2d6b5cafd5a3

Any help would be great!

Thanks!

- Pavel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20131207/c7ec777d/attachment.html>


More information about the Haskell-Cafe mailing list