[ccache] cache coherency across multiple users
cliffwb at 163.com
Fri Apr 1 22:26:18 MDT 2011
What's the method to replace/throw away old .o/.d/.manifest file in cache?
What factors will effected this operation, source code context, path...etc?
发件人: ccache-bounces at lists.samba.org
[mailto:ccache-bounces at lists.samba.org] 代表 Wilson Snyder
发送时间: 2011年4月2日 3:37
抄送: ccache at lists.samba.org
主题: Re: [ccache] cache coherency across multiple users
>A quick question: man page suggests that it is possible to share ccache
>multiple developers by following a set of rules for permissions, umask and
>setting up of ccache dirs env vars etc. What it doesn't talk about is what
>happens if two developers are compiling at the same time and there is a
>miss and ccache needs to write the newly created object to the ccache
>What happens to two (or more) write calls arriving at the same time? Is
>some sort of locking in place to avoid getting garbage in the resultant
>What about the case where one gets a hit and wants to read while the other
>a miss and wants to overwrite the object with the new object file?
>And the case, where cache size management needs to throw away an existing
>file to replace with another object file? Another developer's run may be
>it while this run is throwing it away.
Many companies are using it this way now.
All of these cases are handled correctly by using the atomic
file system rename() calls. An observer will never see
partial state, only a correct file or nothing. There's even
further protection if you enable gzip compressed objects of
a CRC check.
ccache mailing list
ccache at lists.samba.org
More information about the ccache