From: Nguyen Thai Ngoc Duy Date: Thu, 19 Apr 2012 07:02:30 GMT Subject: Re: What's cooking in git.git (Apr 2012, #06; Sun, 15) Message-ID: In-Reply-To: <4F8FB4A0.7090403@viscovery.net> Hi, I've been busy and have not had time to look into this yet... 2012/4/19 Johannes Sixt : > I don't see any mutual exclusion happening in this chain. Perhaps it is > not needed, provided that the pread() call in get_data_from_pack is > atomic. But our git_pread() from compat/pread.c, which we use on Windows, > is not atomic. > > :-( > > I don't think that it is possible to make git_pread() atomic because it > would have to be protected against all file accesses that can modify the > file position. > > Is get_data_from_pack() the only function that accesses the pack data? > Then we could add some mutual exclusion there. I believe so. And index-pack only accesses the pack via pread, no other means. -- Duy