mldonkey-bugs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-bugs] [bug #12761] Cancel is broken


From: anonymous
Subject: [Mldonkey-bugs] [bug #12761] Cancel is broken
Date: Thu, 8 Sep 2005 15:18:18 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Follow-up Comment #23, bug #12761 (project mldonkey):

What if you have two files downloading, using the same swarmer, and you
cancel one of them? Won't your patch forcefully remove the swarmer and break
the download of the other file?  It isn't checking to see that the swarmer
isn't in use by some other file.

The swarmers_by_name in commonSwarming2 is a Weak Hashtable.  (a design
decision of some sort)

Once you set file.file_swarmer <- None for _every_ file that is using the
particular swarmer, the garbage collector will automatically remove the entry
from swarmers_by_name since no one else references it anymore.

Since you have to wait ~2 minutes after cancelling, this means the garbage
collector (GC) didn't yet run.

If you add a call to "Gc.compact ();" in file_cancel (commonInteractive.ml
after "impl.impl_file_ops.op_file_cancel impl.impl_file_val;" ) it should
force the garbage collection immediately after a cancel.  This is very ugly
and slows down each call to file_cancel while garbage is collected.

You can test this theory by 1. starting a download, 2. cancelling it, 3.
running "mem_stats -1", and then 4. trying to redownload the same file.  
(without using your patch)

( mem_stats called with a negative integer parameter calls the garbage
collector. )


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=12761>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]