[Haskell-cafe] STM interfacing with GLFW

Pavel Krajcevski krajcevski at gmail.com
Sat Dec 7 22:33:55 UTC 2013

Turns out this was a bug from removing the GLFW.pollEvents call, rather
than anything having to do with STM. Sorry for the spam!

- Pavel

On Sat, Dec 7, 2013 at 4:35 PM, Pavel Krajcevski <krajcevski at gmail.com>wrote:

> 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/62a2d13c/attachment.html>

More information about the Haskell-Cafe mailing list