Re: [PATCH v7 2/2] Verify index file before we opportunistically update it
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 11, 2014, 20:43 UTC
- Message-ID
- <xmqqmwfrr3zw.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <xmqqtx9zsm8p.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> Yeah, I was hoping that the real write codepath (as opposed to "this > is read only and we read the index without holding a lock---now we > noticed that the index needs refreshing, and we know how the > resulting refreshed index should look like, perhaps we can write it > to save cycles for other processes" codepath where we cannot and > should not take a lock early) would take the lock and then read, but > because that is not the way they work, the need the same protection, > I would think.
Having said that, nobody sane would be running two simultaneous operations that are clearly write-oriented competing with each other against the same index file. So in that sense that can be done as a less urgent follow-up for this topic.