[Rd] Rterm.exe, windows event loop running in multiple threads?

Duncan Murdoch murdoch at stats.uwo.ca
Thu Sep 18 15:28:42 CEST 2008


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



More information about the R-devel mailing list