Todd Lipcon has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/15105 )

Change subject: WIP: Asynchronous code generation
......................................................................


Patch Set 9:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15105/9/be/src/codegen/codegen-fn-ptr.h
File be/src/codegen/codegen-fn-ptr.h:

http://gerrit.cloudera.org:8080/#/c/15105/9/be/src/codegen/codegen-fn-ptr.h@41
PS9, Line 41:   static constexpr std::memory_order mem_order_ = 
std::memory_order_acq_rel;
just passing through: I think you have it correct here. Relaxed is insuffiicent 
because it would permit reordering of the writing of the code and the storing 
of the pointer. In other words, your compilation thread does things like:

1. allocate memory for function machine code
2. write code to allocated memory
3. publish pointer

and without "release" semantics on the publishing of the pointer, there is no 
guarantee that #2 and #3 won't be reordered. In practice, this is really 
unlikely to happen, because there are probably some other locking operations in 
between #2 and #3 and because x86 is a TSO architecture, but worth doing it 
right regardless.

Also worth noting that acq/rel semantics on x86 isn't expensive, they are just 
simple load/store operations. It only prevents compiler reordering. So, there 
is little to gain by using relaxed.



--
To view, visit http://gerrit.cloudera.org:8080/15105
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia7cbfa7c6734dcf03641629429057d6a4194aa6b
Gerrit-Change-Number: 15105
Gerrit-PatchSet: 9
Gerrit-Owner: Daniel Becker <daniel.bec...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bikramjeet....@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <csringho...@cloudera.com>
Gerrit-Reviewer: Daniel Becker <daniel.bec...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>
Gerrit-Reviewer: Zoltan Borok-Nagy <borokna...@cloudera.com>
Gerrit-Comment-Date: Thu, 13 Feb 2020 21:18:56 +0000
Gerrit-HasComments: Yes

Reply via email to