This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [GSoC'19] How to test lock-free code?


On Mon, Jun 17, 2019 at 05:16:18PM +0900, 김규래 wrote:
> Currently, gcc (specifically libgomp) contains some amount of lock-free code.
> Does gcc test for the correctness of the lock-free sections?

No.  Well, there is thread sanitizer, -fsanitize=thread, but it isn't able
to understand the futex etc. operations used in the Linux code in libgomp,
so in order to test the library one needs to use --disable-linux-futex
-fsanitize=thread build.

> Or is it tested just as any other code?

Yes, plus of course when designing the code one needs to think about the
consequences of using lock-free code.  Some platforms (e.g. aarch64 or
ppc64le) have very sensitive hw to bugs in the C/C++ memory model usage,
so some bugs only show up on those platforms and not e.g. on x86_64.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]