hello next to this closed
topicI have some question, In deed i actually using aMule on linux system, and i couldn't find nowhere the options in question in the topic (limit per slots, etc ...) So I will be pleased if someone can tell me where those options are.
My problem is that aMule opens to many upload slots (something like 20) and it make lag my computer.
I have till now to options, the first is to decrease upload bandwidth to something like 10ko/s, so it opens only 4 or 5 slots. But it isn't really satisfying. so much bandwiith unused !
So I decided to make little modification in source code, so have a basic slot control. I found two places where clients are put to upload list. So I add there some basic test like (if number of slots < max number of slot). It seems to work fine, but sometime this number of slots get through this limits. And the matter is that when it does, it consumes all the upload queue!
I search for problem in exclusive portion of code, but in fact i didn't really understand the way aMule uses mutex. It is like it ask for mutex exclusion but never release them!
so please someone can help me, and say me what can i do, to have this working better.
here the two functions where i made modification :
/** file : UploadBandwidthThrottle.cpp
* function : UploadBandwidthThrottler::AddToStandardList
**/
void UploadBandwidthThrottler::AddToStandardList(uint32 index, ThrottledFileSocket* socket)
{
if ( socket )
{
wxMutexLocker lock( m_sendLocker );
if (m_StandardOrder_list.size() < 4) // HERE THE TEST I ADD
{
RemoveFromStandardListNoLock(socket);
if (index > (uint32)m_StandardOrder_list.size())
{
index = m_StandardOrder_list.size();
}
m_StandardOrder_list.insert(
m_StandardOrder_list.begin()
+ index
, socket
);
}
}
}
/** file : Upload
* function : CUploadQueue::Process
**/
void CUploadQueue::Process()
{
// POINT 1
if (AcceptNewClient() && waitinglist.GetCount()
&& uploadinglist.GetSize() < 4 ) // HERE THE OTHER TEST I ADD
{
m_nLastStartUpload = ::GetTickCount();
AddUpNextClient();
}
// POINT 2
... and so on
I suspect the problem is due to the lake of mutex exclusion between Point 1 and Point 2. But i don't know if it's good to put exclusion at this level? If someone has an idea ...
Bah i'll try it and see what happen ...
to be continued