Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 28931200C32 for ; Thu, 9 Mar 2017 21:25:08 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 27223160B75; Thu, 9 Mar 2017 20:25:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6F863160B5F for ; Thu, 9 Mar 2017 21:25:07 +0100 (CET) Received: (qmail 94389 invoked by uid 500); 9 Mar 2017 20:25:06 -0000 Mailing-List: contact reviews-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@impala.incubator.apache.org Received: (qmail 94375 invoked by uid 99); 9 Mar 2017 20:25:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Mar 2017 20:25:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id CC794C14BD for ; Thu, 9 Mar 2017 20:25:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.363 X-Spam-Level: X-Spam-Status: No, score=0.363 tagged_above=-999 required=6.31 tests=[RDNS_DYNAMIC=0.363, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 3cflyivVPEFz for ; Thu, 9 Mar 2017 20:25:04 +0000 (UTC) Received: from ip-10-146-233-104.ec2.internal (ec2-75-101-130-251.compute-1.amazonaws.com [75.101.130.251]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 06B535F1EE for ; Thu, 9 Mar 2017 20:24:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ip-10-146-233-104.ec2.internal (8.14.4/8.14.4) with ESMTP id v29KOrCg019761; Thu, 9 Mar 2017 20:24:53 GMT Message-Id: <201703092024.v29KOrCg019761@ip-10-146-233-104.ec2.internal> Date: Thu, 9 Mar 2017 20:24:53 +0000 From: "Michael Ho (Code Review)" To: impala-cr@cloudera.com, reviews@impala.incubator.apache.org CC: Tim Armstrong , Jim Apple Reply-To: kwho@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-4929=3A_Safe_concurrent_access_to_IR_function_call_graph=0A?= X-Gerrit-Change-Id: I1acd6bad80341121c8189d817e0fe62f2862f28a X-Gerrit-ChangeURL: X-Gerrit-Commit: f46560fb9eda842a7b8971735674647d934a6fe3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.12.7 archived-at: Thu, 09 Mar 2017 20:25:08 -0000 Michael Ho has posted comments on this change. Change subject: IMPALA-4929: Safe concurrent access to IR function call graph ...................................................................... Patch Set 1: (13 comments) http://gerrit.cloudera.org:8080/#/c/6326/1/be/src/codegen/codegen-callgraph.cc File be/src/codegen/codegen-callgraph.cc: Line 27: using namespace strings; > You can use common/names.h instead of the string and unordered_* usings. Done Line 35: Status status = > Can combine this with the below line. Too long after converting to nullptr. PS1, Line 71: boost:: > I believe this creates two unordered_sets (the Lvalue and Rvalue), then cop Done Line 87: call_graph_[key].insert(fn_name); > I think we can use find(key)->insert here, since we don't really want the b The entry may not exist already. Note the entry creation above is for 'fn_name'. Auto-creating entries here is fine as we are constructing the map. We just don't want this to happen after initialization. http://gerrit.cloudera.org:8080/#/c/6326/1/be/src/codegen/codegen-callgraph.h File be/src/codegen/codegen-callgraph.h: Line 21: #include > Use std::unordered_set and _map when possible Good point but it appears that two closely related files llvm-codegen.cc and libcache.cc are already using boost::unordered_* so I'd avoid mixing both to avoid confusion or to further extend the scope of this change. We should clean up all these places in one shot instead. Line 29: class CodegenCallGraph { > One line class comment? Done PS1, Line 39: inline > I believe "inline" is implied for all methods defined in the class body: Done Line 43: if (LIKELY(iter != call_graph_.end())) { > Consider using ? : to make this a one-liner Done PS1, Line 46: NULL > nullptr? Done PS1, Line 51: inline > unnecessary inline Done Line 71: /// and return them in 'users'. > "append them to 'users'", to make it clear that it doesn't clear existing c Done http://gerrit.cloudera.org:8080/#/c/6326/1/be/src/codegen/llvm-codegen.cc File be/src/codegen/llvm-codegen.cc: PS1, Line 290: NULL > nit: we've mostly standardised on nullptr Done PS1, Line 594: (*callees) > nit: unnecessary parens Done -- To view, visit http://gerrit.cloudera.org:8080/6326 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1acd6bad80341121c8189d817e0fe62f2862f28a Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Michael Ho Gerrit-Reviewer: Jim Apple Gerrit-Reviewer: Michael Ho Gerrit-Reviewer: Tim Armstrong Gerrit-HasComments: Yes