Linux DC ++ and multithreading

    Good day to all. In this topic I want to talk about work in DC networks under Linux. I myself am writing from under Linux Mint 7, but on Ubuntu 9.04 everything is identical!
    So, I am the owner of a rather slow Internet channel. In total, as stated in the tariff, 250 kbps (31.25kbytes). In fact, usually 26-28. And if I need something, I’m looking for it first on the DC network. Fortunately, I have a peering in the city of Krasnoyarsk, so there are no problems with the search.

    When I was in Windows, everything was fine with me. I used StrongDC ++ 2.21. Everything is wonderful ... And now, now I'm in Linux. The story of my path is a separate article ...
    Well, of course, the first thing I did was search for alternative programs and ways to run under vine. Found the valknut program. Well, I tried. Well it works. I didn’t like it. IMHO.

    Wine and Flylink


    The experience of using Linux DC ++ was as early as 8.04, which somehow was not very desirable because of bugs. Useful at winehq.org. And I learned that ours, Flylink-r370 works perfectly. Well, I think so. Right now, everything will be the way ... But no ... I downloaded this revision. Installed, launched, under Vine 1.1.25. And yes, this miracle really works. Started testing functionality. Made a ball. Connected to hubs. I decided to download a large file, more than 5 gigs, and so that a sufficiently large number of users had it. Everything, excellent, found. And the first thing I didn’t like was the file icons that confused everything. If it is a file, it looks like a normal folder in XP, and if it is a folder, then the icon is a white folder. Well, I think. Well, for the sake of a working DC client, you can measure it. When I selected the line, I lost the information field, how many people have this file. Well, that was no longer serious. But still bearable for when choosing a large file, I am also guided by this parameter. Put it on the download. Immediately pleased with the speed, 8 MB / s. But the processor load was very upset. Since basically everything is downloaded to me on the ntfs section, which isn’t true, mount.ntfs-3g eats quite a lot of processor time, almost 100%. The bulk was downloaded at a pretty decent speed, almost 8 megabytes per second. BUT (!!!) When there is already less than 10%, the speed dropped to 50 kB / s. I thought that at the same time everyone ran out of slots, or something else. I decided that in a couple of minutes everything would be better. It turned out I was not thinking correctly))). Having opened the list with whom I download. I saw that the download is just leash from two computers. and at a speed of about ~ 30kb. Although before that, he downloaded perfectly with more than 200 users). Closing the connection, he immediately picked up someone at a speed of 2 megabytes per second. Of course, I thought that in the end the blocks swing at a low speed, but not to the same extent, in Strong DC ++ this was not at all. It was the last straw ...

    Linux DC ++


    And I decided to try Linux DC ++ more recent. Quite a lot of time has passed, about a year. Maybe they fixed this bug, that when it started, it just crashed from me.
    So, sudo aptitude install linuxdcpp. And we start ... Surprisingly, it started! It's a sign! I quickly added 5 gig films to the ball to test. I want to warn you that adding to the ball is worth a little, because if you immediately give the task 100 GB, both your computer and Linux DC ++ will go down. You need to add one, at most two folders. So that you can wait for the moment when it has finished the hashing, turn off the client, and start it again, otherwise, at an emergency exit, you will have to go through the hashing procedure again !!! Well, and we entered the hubs. This time I became smarter, and in the settings I installed the download location on the ext3 section. selected a file, no bugs were noticed, only after clicking on the search button the window freezes (gets dark), and I'm waiting for it to finish the search. Selected a test file to download. And waiting. As it turned out, This version is built on a stable kernel that does not support multithreading. But there is 0.707 that supports multithreading, which is what we need. Herethe manual by which I found out where to get the source code of the version with multithreading, and a short guide to action. Having collected all the remaining cookies from the table, I was ready to compile.) Fortunately, the experience is not small ... But I did not want to collect the package, then put it. I decided to do it differently without clogging up the system. Now I’ll tell you everything. so,

    We take the source


    sudo aptitude install bzr scons
    cd ~/
    mkdir linuxdcpp
    cd linuxdcpp
    bzr branch http://bazaar.launchpad.net/~razzloss/linuxdcpp/0705-core

    Great, now we have the source code for fresh linuxdcpp. What can we do with them? Compile!

    Preparing the system for building fresh Linux DC ++


    As written in the manual, further satisfy all the dependencies. Here is a line from my Readme.txt, yours may differ slightly due to the new version: So, if you have ubuntu 9.04 then you should not have problems with old packages. You simply may not have some necessary things. I have indicated the missing plus Bible boost. Well, no question. Here's what I did: This command installed what I didn’t have in the list, and what was old, updated it (I could not find 2 packages g ++> = 3.4, gtk + -2.0> = 2.6, poke your finger, I will add). Now everything is ready for assembly. From the same readme, I read how to properly assemble this assault.
    Dependencies:
    -------------
    scons >= 0.96
    pkg-config
    g++ >= 3.4
    gtk+-2.0 >= 2.6
    gthread-2.0 >= 2.4
    libglade-2.0 >= 2.4
    pthread
    zlib
    libbz2
    libssl



    sudo aptitude install binutils scons pkg-config g++ libboost1.35-dev libglade2-0 libglade2-dev libpthread-stubs0 libpthread-stubs0-dev libbz2 libbz2-dev libssl libssl-dev




    Compilation!!!



    Compiling:
    ----------
    $ cd /path/to/linuxdcpp
    $ scons PREFIX=/path/to/install


    Now the most interesting thing. Since I don’t want to bother, we’ll do pretty clever, we’ll leave the old version. See below for why. :) Now we collect. You can go have a cup of tea. Just not for long, because the most interesting is yet to come ... If everything has been successfully assembled, Congratulations. If not, satisfy the dependencies and read what error log says.

    sudo mkdir /opt/linuxdcpp
    sudo chown -R вашюзер:вашагруппа /opt/linuxdcpp






    cd /path/to/linuxdcpp
    scons PREFIX=/opt/linuxdcpp




    Installation


    It remains to install. The installation is even simpler than compilation:
    scons install

    And now the moment comes, for which we actually made a separate folder, I did not delete the old Linux DC ++ because I am very lazy to build the package and install it. So I chose the easy way, because all this is already provided for by the linuxdcpp build method. We go into the settings of the main menu of the gnome (if you have sneakers, configure it yourself) and look for that DC ++, and in the launch parameters we change only the path from "linuxdcpp" to "/ opt / linuxdcpp / bin / linuxdcpp" (quotes).
    It's time to launch our newly compiled client with multithreading support.
    Of course, as in any program, there are some nuances that have been noticed by me. When choosing a file for downloading, the client starts the download first from one user, but then, if he has time of course), connects to other users, which gives us a significant gain in speed. There is another option, but I did not understand its logic. Click “Search by TTH” on the selected file, and from this list, as I understand it, you can add users from which the jump will take place (if not correct, correct) by clicking on “Match Queue”.
    That's all. I hope you enjoyed this article and helped to avoid using Vine when there is such a cool client.
    Threat. I did not try StrongDC under vine because I was completely satisfied with Linux DC ++.

    Also popular now: