sec/core/lib/gprpp/atomic.h

15 views
Skip to first unread message

Saroj Mahapatra

unread,
Oct 29, 2019, 1:07:42 PM10/29/19
to grpc.io
Hi,

Why does comoare_exchange_week call gpr_atm_inc_cas_then before calling the std function?

Thank you.

Vijay Pai

unread,
Nov 12, 2019, 12:18:56 PM11/12/19
to grpc.io
Those macros are performance-tracking counters used in microbenchmarks. We count our use of atomic operations, locks, and mallocs since these are all (relatively) expensive operations and often foreshadow performance regressions (or improvements). The results of these can be seen on the Checks section of any PR on our Github repo (though they are only shown if there's a significant change).

Ctmahapa95

unread,
Nov 12, 2019, 3:58:53 PM11/12/19
to Vijay Pai, grpc.io
Thanks for confirming my guess. It is completely justified but if I use those classes in non-gRPC code the metrics will be wrong.
The code is really nice and hence I was exploring the possibility of using them outside.


--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/f73544d2-0c5b-45be-914b-0945f8ba1a98%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages