Alo Sarv
lead developer

Donate via
MoneyBookers

Latest Builds

version 0.3
tar.gz tar.bz2
Boost 1.33.1 Headers
MLDonkey Downloads Import Module Development
Payment completed
Development in progress.
Developer's Diary
irc.hydranode.com/#hydranode

Friday, January 28, 2005

UsedRange? Why?!?!

Could someone please tell me what purpose does UsedRange have at all in PartData API ? From what I understand, it's merely additional noise to solve our own internal problems, but gives nothing but trouble to users of the API. Those that aren't quite following what I'm talking about:

PartData *pd;
UsedRange *ur = pd->getRange(partsize);
LockedRange *lr = ur->getLock(size);
lr->write(begin, data);
lr = ur->getLock(size);
lr->write(begin, data);

What purpose does UsedRange have here ? None - UsedRange must still forward the getLock() calls to PartData, since those locks must be shared between multiple UsedRanges, ... why don't we just request locks from PartData directly? Indeed - it would greatly simplify the API ... bye-bye UsedRange.

Just means the internals of PartData just got somewhat more complex. But - better have complex internals, and easy API, instead of vice versa.

Madcat, ZzZz




Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?