Add a README.md for async_safe

Particularly to document why both this and liblog exist, when they do
essentially the same thing.

Test: n/a
Change-Id: I216194402a12270cfbb6bc9b840d054dc9c1dc16
This commit is contained in:
Tom Cherry 2020-01-17 09:37:26 -08:00
parent f5421dde7f
commit 2185a12312
1 changed files with 10 additions and 0 deletions

10
libc/async_safe/README.md Normal file
View File

@ -0,0 +1,10 @@
# 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.