]> git.openfabrics.org - ~shefty/librdmacm.git/commit
librspreload: Support server apps that call fork()
authorSean Hefty <sean.hefty@intel.com>
Tue, 24 Jul 2012 18:40:10 +0000 (11:40 -0700)
committerSean Hefty <sean.hefty@intel.com>
Tue, 24 Jul 2012 22:27:28 +0000 (15:27 -0700)
commite4a127d51d3f9de2dff53942ab63987b3f236549
tree04a586373bea04b3e94c31fe01c365a50b7c1bf1
parent3e52eb22f44eafaefa95c4674bc5665a94e15694
librspreload: Support server apps that call fork()

Provide limited support for applications that call fork().  To
handle fork(), we establish connections using normal sockets.
The socket is later converted to an rsocket when the user
makes the first call to a data transfer function (e.g. send,
recv, read, write, etc.).

Fork support is indicated by setting the environment variable
RDMAV_FORK_SAFE = 1.  When set, the preload library will delay
converting to an rsocket until the user attemts to send or receive
data on the socket.  To convert from a normal socket to an
rsocket, the preload library must inject a message on the
normal socket to synchronize between the client and server.  As
a result, if the rsocket connection fails, the ability to
silently fallback to the normal socket may be compromised.  Fork
support is disabled by default.

The current implementation works for simple test apps under
ideal conditions.  Although it supports nonblocking sockets, it
uses blocking rsockets when migrating connections.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/preload.c