patchmldonkey, a multi-networks file-sharing client - Patches: patch #5130, CommonSwarming: WIP4a'


You are not allowed to post comments on this tracker with your current authentication level.

patch #5130: CommonSwarming: WIP4a'

Submitted by:  spiralvoice <spiralvoice>
Submitted on:  Thu 25 May 2006 06:48:53 PM UTC  
Category:  Bug fixes Priority:  5 - Normal
Status:  Done Assigned to:  None
Open/Closed:  Closed

Thu 25 May 2006 07:49:32 PM UTC, comment #2: 

Applied 2006/05/25

spiralvoice <spiralvoice>
Project Administrator
Thu 25 May 2006 07:31:14 PM UTC, comment #1: 

That's a huge patch over CommonSwarming module (whose job is to select what data to ask from connected sources, and the merging of received data), I hope I'm not forgetting anything important :

  • first, it's a mantainance patch; Lots of code have been reworked for readability and compactness (iterators...), functions grouped together, sometimes renamed to more descriptive names. Lots of comments have been added, including the description of invariants I've found, and a nice ASCII art schema of the swarming datastructures ;)
  • naming has been made more consistant, to differenciate chunks (from each network view) from blocks (internal to swarming), and intervals (list of int64 * int64 beggining/end offset pairs)
  • Support for bitmaps encoded as strings (AvailableCharBitmap) removed, since it's no longer used anywhere; use the more compact AvailableBitv instead
  • Removed range_current_begin from ranges, it's enough for a range to have a beginning and a end ;)
  • Rewrote compute_block_num to have precise preconditions, and algorithm proof
  • Added some assertions to better enforce invariants (on verification bitmaps, for example)
  • Allocation of ranges is now delayed until the very last moment, instead of when a chunk starts being downloaded. Main benefit (beside small memory gain) is that requests for different ranges sizes can be fulfilled at any time.
  • Modified received function so that no BAD WRITE message can happen anymore: condition when data that does not start from the beginning of a range is correctly detected and data discarded (since ranges cannot handle that case anyway)
  • Rewrote a much simpler version of present_intervals
  • Rewrote block selection algorithm for readability and flexibility; select_block simply "folds" over all available blocks, using compare_choices function to keep the best available one(s). May need some more CPU (no fast exit)
  • Fixed donkey uploaders calls when disconnected
  • Reenable the copy of identical chunks between files. Opportunities for copies are checked every 5 minutes.
  • Made file writing a bit smarter in Unix32 module so that writing zeroed chunks (as can happen a lot with chunks copying) on an otherwise sparse temp file does not allocate disk space. A bit hackish.
pango <mlpango>
Project Member
Thu 25 May 2006 06:48:53 PM UTC, original submission:  
spiralvoice <spiralvoice>
Project Administrator


Attached Files
file #10052:  swarming_fixes-WIP4a1.patch added by spiralvoice (198KiB - application/octet-stream - including small logging updates on top of WIP4a')


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.




Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-05-25 spiralvoice StatusNone => Done
    Open/ClosedOpen => Closed
2006-05-25 spiralvoice Attached File- => Added swarming_fixes-WIP4a1.patch, #10052

Back to the top

Powered by Savane 3.7