[Openais] non blocking logging support

Steven Dake sdake at redhat.com
Fri Aug 4 18:58:07 PDT 2006


The following patch uses the available worker threads to ensure
log_printf takes about 10-15usec instead of 1-200msec as is possible
with some builds of syslog.  This is done by creating a special thread
to execute the blocking-specific operations (such as file write and
syslog) which could delay operation of the system.

Basically when a log_printf is called, it is added to a list.  Another
thread reads from the list available log messages and outputs them to
file, stderr, and the syslog based upon the logging configuration.

If the internal storage buffers overflow for the logging system, a
message like the following is printed:

Aug  4 18:44:32.444584 [MAIN ] Syslog entry 989
Aug  4 18:44:32.444817 [MAIN ] Syslog entry 1002 - prior to this log
entry, openais logger dropped '13' messages because of overflow.
Aug  4 18:44:32.447804 [MAIN ] Syslog entry 1177 - prior to this log
entry, openais logger dropped '175' messages because of overflow.

Regards
-steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wthread-log.patch
Type: text/x-patch
Size: 8221 bytes
Desc: not available
Url : http://lists.linux-foundation.org/pipermail/openais/attachments/20060804/4e18a963/wthread-log-0001.bin


More information about the Openais mailing list