Any change of rsync using threads instead of fork?

Wayne Davison wayned at samba.org
Sat Dec 17 23:47:05 GMT 2005


On Sat, Dec 17, 2005 at 11:22:58PM +0000, Jamie Lokier wrote:
>   rsync: mkstemp "/mnt/storage/bin/" failed: Success (0)

That makes me wonder if the thread handling is not properly giving
each thread its own errno.

>   ./rsync: io.c: 334: push_redo_num: Assertion `am_receiver()' failed.

That should only occur (that I know of) if pthread_self() isn't
returning the right value.

Perhaps your file-I/O routines are not thread-safe?  I'd suggest
downloading GNU pth and trying out rsync using that.  Be sure to
configure *pth* with "--enable-syscall-soft --enable-pthread", build it,
but there's no need to install it; if you tweak rsync's one include of
pthread.h (that should be in rsync.h in the latest patch) to include
pth's pthread.h file, and then tweak rsync's Makefile to link against
the pth/.libs/libpthread.a library (instead of using -lpthread), that
should get you going using the pth library's threading support.  The
nice thing about doing this is that none of the system's libraries need
to be thread-safe for this scenario because the software does its own
context switching when various read/write/select function calls happen.

..wayne..


More information about the rsync mailing list