[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [GNUnet-developers] Re: [Help-gnunet] trouble with cvs
From: |
Christian Grothoff |
Subject: |
Re: [GNUnet-developers] Re: [Help-gnunet] trouble with cvs |
Date: |
Tue, 9 Dec 2003 16:25:34 -0500 |
User-agent: |
KMail/1.4.3 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Friday 07 November 2003 05:57 pm, Igor Wronsky wrote:
> Btw, in insertContent(), whats this supposed to achieve,
>
> if ( ( sender != NULL) &&
> ( randomi(2 + importance) == 0) ) {
> return SYSERR; /* don't bother... */
> }
>
> ? Yes, I can read what it does. Whats the reasoning?
Ok, let me recap what it does first (since it is out-of-context...).
If we're not processing content originating from the local user (sender !=
NULL) and the content has been decided to be of low value, we
probabilistically do not even bother going to the database to see if we have
space to store it.
Reasoning: processing the database (find lowest-priority content or find that
we have enough space, do the insertion, etc) costs us many disk-accesses. If
the content additionally has a rather low priority, it is likely that this
whole process will fail (lowest-priority content has higher or equal priority
to new content). So we just don't do it all the time. Which also makes it
slightly harder to predict whether or not a given peer will cache content
floating by. Now, the exact formula (2+importance) comes from that even
importance == 0 should have a chance to be added to the local DB.
Christian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE/1j3O9tNtMeXQLkIRAvOlAJ9D/+QEaPz+zoNu+opBRT40uzXGeQCggkAo
KyZKAQB324D7ode/qdvgdT0=
=aX+g
-----END PGP SIGNATURE-----