I have checked this plzip binary ( binaries.przemoc.net binaries.przemoc.net )
and it seems to work (compression is faster as it should be, decompression is
~10% slower than lzip, no matter what - seems to use only 1 thread). I'm
actually surprised as I tried that before and it didn't work except for one
thread, which is equivalent to (c)lzip. Reason was simple (or at least
that's what I thought) - my pread() was not thread safe and was actually
changing, although temporarily during read(), file pointer: ssize_t
pread_(int fd, void *buf, size_t count, off_t offset) { ssize_t read_count;
off_t cur_pos; cur_pos = lseek(fd, 0, SEEK_CUR); if (lseek(fd, offset,
SEEK_SET) < 0) return -1; read_count = read(fd, buf, count); if (cur_pos
!= lseek(fd, cur_pos, SEEK_SET)) return -1; return read_count; } #define
pread pread_ Now, I don't get why ssize_t pread (int fd, void *buf,
size_t count, __int64 offset)
{
_lseeki64 (fd, offset, SEEK_SET);
return read (fd, buf, count);
} // @ sourceforge.net sourceforge.net or ssize_t pread(int fd, void *buf,
size_t count, long long offset) { (...) ret = ReadFile(fh, buf,
(DWORD)count, &bytes, &o); (...) } // @ gist.github.com
gist.github.com would work as they don't preserve file pointer, and are
not thread safe either.
_______________________________________________
Lzip-bug mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lzip-bug