Michael Lawrence
2008-Sep-18 12:59 UTC
[Rd] Rterm.exe, windows event loop running in multiple threads?
For processing events, RGtk2 has moved away from using the old tcl_do hack and now synchronizes on the Windows event loop. In Rgui.exe this works fine (well mostly), but in Rterm.exe, users report the following warning from GLib: "main loop already active in another thread". The most obvious way this could occur is if the Windows event loop were iterating in multiple threads. This does not seem to be the case from my casual inspection of the R source. Any help is appreciated. Thanks, Michael [[alternative HTML version deleted]]
Duncan Murdoch
2008-Sep-18 13:28 UTC
[Rd] Rterm.exe, windows event loop running in multiple threads?
On 18/09/2008 8:59 AM, Michael Lawrence wrote:> For processing events, RGtk2 has moved away from using the old tcl_do hack > and now synchronizes on the Windows event loop. In Rgui.exe this works fine > (well mostly), but in Rterm.exe, users report the following warning from > GLib: "main loop already active in another thread". The most obvious way > this could occur is if the Windows event loop were iterating in multiple > threads. This does not seem to be the case from my casual inspection of the > R source.Rterm sets up separate threads to handle Windows messages and console input, so that the graphics devices can be updated while the console is waiting for input. You can see the source in src/gnuwin32/system.c: look for "lineavailable", which indicates that the reader thread has read something. Duncan Murdoch