Hello Alexey Serbin, Kudu Jenkins, Andrew Wong, Todd Lipcon,

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/15401

to look at the new patch set (#3).

Change subject: threadpool: simplify Submit API
......................................................................

threadpool: simplify Submit API

In an effort to modernize our codebase, I'm working to reduce the usage of
boost::bind and std::bind. They can be actively harmful[1], and by
comparison, lambdas offer the compiler more opportunities to inline. Also,
std::bind tends to be aggressive with using allocations for storage, though
boost::bind is better about this.

This patch modifies ThreadPool to expose just a single Submit API which
expects an std::function. Furthermore, all callers have been converted away
from bind-based function creation and towards lambdas, which implicitly cast
to std::function.

There are contortions in a couple places to accommodate the lack of C++14
lambda support (e.g. we need capture-by-move semantics in RaftConsensus),
but these are minimal.

1. https://abseil.io/tips/108

Change-Id: I2bd2d59809225e4cde7e273e95428478a282aa2d
---
M src/kudu/codegen/compilation_manager.cc
M src/kudu/consensus/consensus-test-util.h
M src/kudu/consensus/consensus_peers.cc
M src/kudu/consensus/consensus_queue.cc
M src/kudu/consensus/log.cc
M src/kudu/consensus/raft_consensus.cc
M src/kudu/fs/dir_manager.cc
M src/kudu/master/catalog_manager.cc
M src/kudu/master/master.cc
M src/kudu/rpc/reactor.cc
M src/kudu/tablet/tablet_replica.cc
M src/kudu/tablet/transactions/transaction_driver.cc
M src/kudu/thrift/client.h
M src/kudu/tools/ksck.cc
M src/kudu/tools/ksck_checksum.cc
M src/kudu/tools/ksck_remote.cc
M src/kudu/tools/table_scanner.cc
M src/kudu/tserver/ts_tablet_manager.cc
M src/kudu/tserver/ts_tablet_manager.h
M src/kudu/util/countdown_latch-test.cc
M src/kudu/util/curl_util-test.cc
M src/kudu/util/maintenance_manager.cc
M src/kudu/util/net/dns_resolver.cc
M src/kudu/util/net/dns_resolver.h
M src/kudu/util/threadpool-test.cc
M src/kudu/util/threadpool.cc
M src/kudu/util/threadpool.h
27 files changed, 256 insertions(+), 360 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/01/15401/3
--
To view, visit http://gerrit.cloudera.org:8080/15401
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2bd2d59809225e4cde7e273e95428478a282aa2d
Gerrit-Change-Number: 15401
Gerrit-PatchSet: 3
Gerrit-Owner: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>

Reply via email to