[bittorrent] Introductory/endgame algorithms

Arvid Norberg c99ang at cs.umu.se
Wed Sep 28 17:09:50 EDT 2005


On Sep 28, 2005, at 15:09, Jari Sundell wrote:
> On 9/28/05, Olaf van der Spek <olafvdspek at gmail.com> wrote:
> If there's enough RAM, can't you simply prefetch all files  
> completely into RAM?
>
> I haven't considered doing this explicitly, I use mmap'ed files  
> directly and the kernel keeps the pages in memory if there's room.  
> If the user wants to preload the files, he may use dd or similar to  
> dump them into /dev/null.

Assuming you support files larger than the address space of the  
machine (2 GB for an ordinary 32-bit machine), how do you do your mmap?

Do you move it around to parts of the files that gets the most read  
and write requests and use ordinary io for the rest? or do you create  
and free the mmap() for each read/write operation? (do you have any  
idea if that would incur big performance hits?).

--
Arvid Norberg





More information about the BitTorrent mailing list