2016-06-09 15:24 GMT+02:00 Kirill Frolov <kirill.fro...@dev.zodiac.tv>:
> Hello, All!
>
> How can I annotate source code (see below) to stop valgrind's DRD
> tool complain about data race?
>
> I think this source doesn't contain any data race, but DRD thinks
> otherwise. This is because common synchronization primitives (like
> mutexes) not used in this case. The code relies on possibility of CPU
> to swap 's' pointer atomically.
>
>
You need to help DRD in such cases because as you said you are not using
common synchronization primitives. The question is also why?
I was not able to discern your intention but it seems to me you are
introducing
a barrier or a producer-consumer queue. There are efficient POSIX
synchronization
primitives for these tasks which DRD supports natively.
Otherwise use DRD client requests [1] to annotate your intent.
Kind regards,
I.
[1] http://valgrind.org/docs/manual/drd-manual.html#drd-manual.clientreqs
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users