mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
a31f57db1a
Summary: In glibc, pthread cancellation support adds two atomic CAS operations to each "cancellation point" syscall (see pthreads(7)). This includes read() and write(). We can avoid that overhead by disabling pthread cancellation at the start of the FUSE worker threads. This saves two CAS operations (~40 ns) in the critical FUSE request processing loop. Reviewed By: simpkins Differential Revision: D21469690 fbshipit-source-id: 7f28a2a8e831006351657981e901dc572c58cf48
23 lines
589 B
C++
23 lines
589 B
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
namespace facebook {
|
|
namespace eden {
|
|
|
|
/**
|
|
* Disable pthread cancellation for the calling thread. This improves
|
|
* performance in glibc for cancellation point syscalls by avoiding two atomic
|
|
* CAS operations per syscall. See pthreads(7) for the list of functions that
|
|
* are defined to be cancellation points.
|
|
*/
|
|
void disablePthreadCancellation();
|
|
|
|
} // namespace eden
|
|
} // namespace facebook
|