Multithreaded operations(signature generation)

22 views
Skip to first unread message

hossein...@gmail.com

unread,
Apr 2, 2016, 12:03:15 AM4/2/16
to librsync
Hi,
I took a look at the whole file api and it seems that it's single threaded and on a system with more than one core, the processing power is not utilized for the signature generation and the other operations.

On the documentation i found the pull and push modes but I am not sure which one is useful so i need some declaration.

What i want to achieve is to start x number of threads, lets say 4. Each thread will open the same file of lets say 40bytes and read at different positions to calculate:
Thread 1: read 0-9bytes from 'ab.txt' => calculate sig into a temp file
Thread 2: read 10-19bytes from 'ab.txt' => calculate sig into a temp file
Thread 3: read 20-29bytes from 'ab.txt' => calculate sig into a temp file
Thread 4: read 30-39bytes from 'ab.txt' => calculate sig into a temp file

and finally concatenate all files and get the sig file.

So i don't know if this scenario is even possible. Any help would be appreciated.

Reply all
Reply to author
Forward
0 new messages