*** Welcome to piglix ***

Libtorrent

libtorrent
Developer(s) Arvid Norberg
Initial release 0.9 (September 2005)
Stable release 1.1.3(April 2, 2017; 53 days ago (2017-04-02))
Written in C++
Operating system Cross-platform
Available in English
Type BitTorrent library
License BSD license (Free software)
Website www.libtorrent.org

libtorrent is an open source implementation of the protocol. It is written in and has its main library interface in C++. Its most notable features are support for Mainline DHT, IPv6, HTTP seeds and µTorrent's peer exchange.

libtorrent uses Boost, specifically Boost.Asio to gain its platform independence. It is known to build on Windows and most Unix-like operating systems (OS X, Linux, and many BSDs).

Its original author is Arvid Norberg.

libtorrent is kept up to date with the most useful bittorrent extensions and is constantly being optimized to work in a broader set of environments. Many of its features can be disabled at compile time to not include code that would not be used in a particular use case. It aims to be the most suitable libtorrent implementation for embedded devices as well as desktops and seed-servers. Some of its implementation details are described in the features section.

libtorrent was the first client to support the extension protocol together with µTorrent, which is now a foundation that many other extensions build upon.

All disk I/O in libtorrent is done asynchronously to the network thread, by the disk io thread. When a block is read, the disk io thread reads all subsequent blocks from that piece into the read cache, assuming that the peer requesting the block will also request more blocks from the same piece. This decreases the number of syscalls for reading data. It also decreases delay from seeking.

Similarly, for write requests, blocks are cached and flushed to disk once one full piece is complete or the piece is the least recently updated one when more cache space is needed. The cache dynamically allocates space between the write and read cache. The write cache is strictly prioritized over the read cache.

The cache blocks that are in use, are locked into physical memory to avoid it being paged out to disk. Allowing the disk cache to be paged out to disk means that it would become extremely inefficient to flush it, since it would have to be read back into physical memory only to be flushed back out to disk again.


...
Wikipedia

...