[cfe-dev] Who is working on/has worked on Capability analysis (-Wthread-safety)?

Randell Jesup via cfe-dev cfe-dev at lists.llvm.org
Sat Oct 30 21:27:30 PDT 2021


I'm looking to find and document the best ways to use clang 
thread-safety features (capability analysis), especially for some common 
patterns of access such as a single reader/writer thread with multiple 
reader threads, and also to document how to use it for thread-locked 
access checking -- there's a single example involving a ThreadRole.h 
file to set up uses of capabilities for tracking threads.   There's a 
brief mention of it on the paper, and also a longer example at 
https://insights.sei.cmu.edu/blog/thread-safety-analysis-in-c-and-c/ .   
However, that's from 2014, and it doesn't cover a lot of possible uses.

One way to possibly handle the reader/writer vs readers case (where 
reads on the writing thread don't need to lock) would be to be able to 
say "guarded by this or that", in this case something like 
GUARDED_BY(mMutex, MainThread) (GUARDED_BY(mMutex || MainThread) ??).

   Randell Jesup, Mozilla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20211031/3e49bef4/attachment.html>


More information about the cfe-dev mailing list