lib: Add unix_msg
authorVolker Lendecke <vl@samba.org>
Mon, 24 Feb 2014 11:48:16 +0000 (11:48 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 23 Apr 2014 20:33:08 +0000 (22:33 +0200)
commit6dcf2c7eab0f39a17f22b09df94e5fcdac8726d1
tree1331e1c62bb2d40e552dd6b1e48f851d84bf4d58
parentbafdecdf1fb110b02796a6357b1501777195f9d9
lib: Add unix_msg

This is a messaging layer based on unix domain datagram sockets.

Sending to an idle socket is just one single nonblocking sendmsg call. If the
recv queue is full, we start a background thread to do a blocking call. The
source4 based imessaging uses a polling fallback. In a situation where
thousands of senders beat one single blocked socket, this will generate load on
the system due to the constant polling. This does not happen with a threaded
blocking send call.

The threaded approach has another advantage: We save become_root() calls on the
retries. The access checks are done when the blocking socket is connected, the
threaded blocking send call does not check permissions anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/unix_msg/test_drain.c [new file with mode: 0644]
source3/lib/unix_msg/test_source.c [new file with mode: 0644]
source3/lib/unix_msg/tests.c [new file with mode: 0644]
source3/lib/unix_msg/unix_msg.c [new file with mode: 0644]
source3/lib/unix_msg/unix_msg.h [new file with mode: 0644]
source3/lib/unix_msg/wscript_build [new file with mode: 0644]
source3/wscript_build