julien-lebot / appstract

Automatically exported from code.google.com/p/appstract
0 stars 0 forks source link

Send guest's log messages async to the host #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently the guest sends it's log messages synchronously to the host, where 
the message is then written synchronously to the output stream.

Marking the log-methods specified in IServerReporter with the 
OneWayAttribute makes target processes start up in mere milliseconds, 
whereas the current start up time may take up to 10 seconds. A negative side-
effect of this change is that log message are processed extremely slow. And 
messages that didn't arrive before the guest process terminates will never 
make it to the log.

Therefore log messages must be sent fast and asynchronously. Either by 
giving each message it's own thread from a thread pool, or by using a 
message queue which sends multiple messages as a batch.

Original issue reported on code.google.com by simon_al...@hotmail.com on 15 Mar 2010 at 2:36

GoogleCodeExporter commented 8 years ago
r243:
GuestCore now has a property named "Log", which is the central log service of 
the 
guest process.

The implementation of this log service depends on whether or not the library is 
compiled with the "SYNCLOG" symbol defined.
If "SYNCLOG" is defined, the log messages are sent synchronously to the host 
process; Otherwise, the log messages are queued and asynchronously sent as 
batches 
to the host process.
Currently this synchronization happens every 100ms, although in later revisions 
this 
value should be revised and maybe be made more dynamic by making it depend on 
the 
amount of enqueued messages.

Original comment by simon_al...@hotmail.com on 16 Mar 2010 at 9:34

GoogleCodeExporter commented 8 years ago
The "SYNCLOG" compilation symbol is introduced because in some cases debugging 
is a 
lot easier when the log messages are displayed synchronously with what is 
actually 
happening in the code.

Original comment by simon_al...@hotmail.com on 16 Mar 2010 at 9:37