[ccache] cache coherency across multiple users

wangbin cliffwb at 163.com
Fri Apr 1 22:26:18 MDT 2011


Hi,All
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? 
Thanks

Wang,bin

-----邮件原件-----
发件人: ccache-bounces at lists.samba.org
[mailto:ccache-bounces at lists.samba.org] 代表 Wilson Snyder
发送时间: 2011年4月2日 3:37
收件人: devsk
抄送: 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
across 
>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
cache 
>miss and ccache needs to write the newly created object to the ccache
directory.
>
>What happens to two (or more) write calls arriving at the same time? Is
there 
>some sort of locking in place to avoid getting garbage in the resultant
object 
>file?
>
>What about the case where one gets a hit and wants to read while the other
gets 
>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
object 
>file to replace with another object file? Another developer's run may be
reading 
>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
https://lists.samba.org/mailman/listinfo/ccache




More information about the ccache mailing list