aosp12/bionic/libc/async_safe
hcl 7be3fd486c init from android-12.1.0_r8 2023-01-09 17:11:35 +08:00
..
include/async_safe init from android-12.1.0_r8 2023-01-09 17:11:35 +08:00
Android.bp init from android-12.1.0_r8 2023-01-09 17:11:35 +08:00
README.md init from android-12.1.0_r8 2023-01-09 17:11:35 +08:00
async_safe_log.cpp init from android-12.1.0_r8 2023-01-09 17:11:35 +08:00

README.md

async_safe logging

This library provides an async_safe implementation for formatting and writing log messages to logd.

Note that the liblog implementation connects a single socket to logd and uses a RWLock to manage it among threads, whereas these functions connect to liblog for each log message. While it's beneficial to have this lock-free and therefore async_safe mechanism to write to logd, connecting a socket for each message does not scale well under load. It was also determined to be too costly to connect a socket for each thread as some processes, such as system_server, have over 100 threads. Therefore, we maintain these two separate mechanisms.