[3078] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[PATCH 0/2] Asynchronous logging for barnowl, with clean history

daemon@ATHENA.MIT.EDU (Adam Glasgall)
Thu May 26 00:27:45 2011

From: Adam Glasgall <glasgall@MIT.EDU>
To: barnowl-dev@mit.edu
Date: Thu, 26 May 2011 00:27:35 -0400

[Resending with cleaned-up history; now there are only two patches to
review; the API change to owl_select_post_task and async_logging proper]

Currently, when message logging is enabled, barnowl writes logs
synchronously on the same thread as the UI, network I/O, and
everything else. This results in an extremely unpleasant user
experience when writing a log entry takes a long time (e.g. when
logpath/classlogpath point to a directory in AFS and the fileserver
for that volume is down), as the UI freezes until the kernel gives up
and returns an error, during which time more messages have come in to
be processed and logged, which themselves cause the UI to freeze, and
so on. The user usually cannot even kill the frozen barnowl, as it's
probably stuck in uninterruptible sleep.

Now that we have g_main_loop merged, it's possible for us to do
better. This patch moves log-entry writing off onto a background
thread running running its own GMainLoop; instead of writing logs
itself, the main thread posts tasks to it.

This branch is also available for review on my github at
https://github.com/aglasgall/barnowl/, branch 'async_logging_v3'.

Adam Glasgall
--
Net delta:
 logging.c |  237 ++++++++++++++++++++++++++++++++++++++++++++-----------------
 owl.c     |    5 +-
 select.c  |   14 +++--
 3 files changed, 186 insertions(+), 70 deletions(-)


home help back first fref pref prev next nref lref last post