[PATCH 1/3] Use cache for base repo if possible
Samantha N. Bueno
sbueno+anaconda at redhat.com
Tue Oct 22 17:41:51 UTC 2013
On Tue, Oct 22, 2013 at 09:31:58AM +0200, Vratislav Podzimek wrote:
> On Mon, 2013-10-21 at 09:44 -0400, Samantha N. Bueno wrote:
> >
> > Two variables assigned the same value, seems like it should just be one.
> The answer here applies to both your questions/comments. The reason for
> two locks and also the nested with blocks here is granularity -- if we
> had only one lock acquired for the whole refresh process, for checking
> cache validity and taking the value, we would end up with just another
> name for the _yum_lock.
>
> This way the two locks just
>
> a) make sure nobody can check cache validity and then get invalidated
> value (the test-and-get and test-and-set operations need to be done
> atomically) and
>
> b) make sure no callbacks are enqueued while callbacks are already being
> run (that could cause some callback to be left out never called)
>
> and since they are both released ASAP, calls with wait=False should
> never take long time.
Gotcha, I see where you're going now, and thanks for explaining. Ack.
Samantha
More information about the anaconda-patches
mailing list