Hi, On Sat, Mar 15, 2014 at 5:37 PM, Richard Neswold wrote: > Hello, > > What would be the appropriate way to use LWT and LabGL together? > > My gut feeling would be to have the core model and logic to be LWT with a > 'detached' thread executing the OpenGL main loop. The thread would get > events through the reactive module and would update the display accordingly. > > The problem is I'm still trying to wrap my head around LWT and I'm not > sure a detached thread can participate with the LWT environment it was > spawned from. It appears the detached thread is supposed to do something > and eventually return a value. > Yes, the purpose of Lwt_preemptive.detach is to execute a blocking action in a separate system thread in order not to block all lwt threads. And from another system thread you cannot run lwt code directly, you have to use Lwt_preemptive.run_in_main. > Is the correct approach to use a detached thread to make the individual > OpenGL calls? > I think that would be very slow, as in involves system thread synchronization. > Any recommendations or resources on the subject would be appreciated. > You could try to assume that OpenGL calls are fast and perform them in the same thread as lwt. -- Jeremie