- 19 Apr, 2018 4 commits
-
-
Dave Watson authored
Summary: prepare() blocks mostly just lock locks, but we don't know what order to lock - so similar to std::lock, just iterate using try_lock until success. Reviewed By: ot Differential Revision: D7676738 fbshipit-source-id: 2e0d28e4829a3a21d361a5801383c1aad0d66757
-
Tushar Maheshwari authored
Summary: Summary of the changes --- - Fix broken MSVC build: - Compiling `GenerateFingerprintTables.cpp` complained about missing header file `glog/logging.h`. - Targets `GenerateFingerprintTables` and `folly_fingerprint` don't specify `FOLLY_INCLUDE_DIRECTORIES` in its include directories. * Introduce a "shiny" target `folly_deps` for managing folly's dependencies and interface specification. * `folly_deps` is an [INTERFACE library target](https://cmake.org/cmake/help/v3.0/command/add_library.html). * It encapsulates the interface dependencies (compile definitions, include directories, link libraries, etc.) for other targets. * The usage of the new target is clean and simple: `target_link_libraries(<target_name> (PUBLIC|PRIVATE) folly_deps)` (except for OBJECT library targets, like `folly_base` - included in the change). Possible modifications --- The name `folly_deps` could be replaced with a better one. The target can be extended to include the PUBLIC compile options set on individual targets. Reviews and suggestions welcome. Closes https://github.com/facebook/folly/pull/818 Reviewed By: simpkins Differential Revision: D7642870 Pulled By: Orvid fbshipit-source-id: c1c5fdae67f5a677c82f05757217af6b6de9db02
-
Subodh Iyengar authored
Summary: Turns out we needed this method to be virtual to mock it out in tests because it makes a bunch of syscalls. Reviewed By: yangchi Differential Revision: D7665938 fbshipit-source-id: 1ae5768ade2c927929f5cb1f9e1ad62dad1ba237
-
Giuseppe Ottaviano authored
Reviewed By: aary Differential Revision: D7680645 fbshipit-source-id: 6a3742c215a6924ec5c1c5b8bc1d2bff315355e7
-
- 18 Apr, 2018 5 commits
-
-
Aaryaman Sagar authored
Summary: Add `try_lock` methods to `folly::Synchronized` and add the corresponding extensions to `LockTraits`. These return `LockedPtr`s that are valid and convert to true when the lock operation was successful, null otherwise override-unit-failure Reviewed By: yfeldblum, ot Differential Revision: D7651765 fbshipit-source-id: eb85987a2e4476cd916747dfc2ae69d124690ee6
-
Marc Celani authored
Summary: TDigest is designed to process a stream of data in batches. DigestBuilder is a fast, thread safe approach for buffering those writes and building a digest. Reviewed By: davidtgoldblatt Differential Revision: D7582745 fbshipit-source-id: 528ad9b21685746887b3a602d433662221fb875a
-
Dave Watson authored
Summary: Use new refcount hazptr feature. This prevents many roundtrips through release()->retire()->~Node()->release()->retire() etc, and instead can call delete immediately through most of the chain See D6142066 Reviewed By: yfeldblum Differential Revision: D6290004 fbshipit-source-id: d8cfb2aa41260918a7f201765febc31d558742bb
-
Dan Melnic authored
Summary: Revert "Use unbounded queue in NotificationQueue" Reviewed By: magedm Differential Revision: D7669679 fbshipit-source-id: 269139fc8238896640fc60ed36c83e728ed489b4
-
Marc Celani authored
Summary: This diff adds reads for sum, mean, and count on TDigest. The results are calculated at merge time, to make reads O(1). Reviewed By: anakryiko Differential Revision: D7639133 fbshipit-source-id: bb8f203ec0ed3197f090d2ce9223a2e9d1bca752
-
- 17 Apr, 2018 9 commits
-
-
Subodh Iyengar authored
Summary: Unset the error message callbacks when err message so that we dont deliver errors when not needed Reviewed By: yfeldblum Differential Revision: D7661052 fbshipit-source-id: 5a2330b2cd11f844649d56343307e2c75b626bdc
-
Dave Watson authored
Summary: blame D7477268. Some callsites use UnboundedBlockingQueue with non-copyable CPUTasks, must also have std::move here. Reviewed By: yfeldblum Differential Revision: D7655710 fbshipit-source-id: cf8dba1df0c1703ffea1c0c0445c7d14deaf1d61
-
Nathan Bronson authored
Summary: Add missing markdown notation Reviewed By: shixiao Differential Revision: D7655769 fbshipit-source-id: a0db34846e48afd845b8878de84764d30330b096
-
Dave Watson authored
Summary: add try_take_for to BlockingQueue, utilizing new LifoSem::try_wait_for method. To be used to kill threads after an idle period in CPUThreadPoolExecutor. Reviewed By: magedm Differential Revision: D7477268 fbshipit-source-id: 76ea7fa1fc3b4b5f7a7529ce1424a91eef2ac7b1
-
Dave Watson authored
Summary: Linux's futex checks the waiter count atomically before grabbing the lock. This results in much better perf if there are no waiters and you call futexWake(). Add the same improvement to ParkingLot. Reviewed By: yfeldblum Differential Revision: D6639337 fbshipit-source-id: 6e03eff07e4c9ce327bc66d0aabd8cec051a5b19
-
Nikita Lutsenko authored
Summary: According to headers, `pthread_getname_np` and `pthread_setname_np` are available since iOS 3.2 and macOS 10.6. However, guarding just on min macOS version isn't going to work for iOS/watchOS/tvOS, because it's very rarely defined. So add another case for when `__IPHONE_OS_VERSION_MIN_REQUIRED` is defined and is above iOS 3.2, which will also make watchOS and tvOS work. Reviewed By: yfeldblum Differential Revision: D7648204 fbshipit-source-id: 1e608cdad3f39242eff79fbb6da8e560eeee720a
-
Jeffrey Shen authored
Summary: If the default inline executor is used for folly::window, and all the futures generated by the callback are also inline, then all spawn function calls (and their associated Futures) are added to the call stack and can overflow. This fixes that issue by using QueuedImmediateExecutor, which will put the executor callback into a thread-local queue, allowing the current function to exit and destruct all objects in its stack frame. Then, only the first call to QueuedImmediateExecutor in a thread is responsible for running each subsequent callback and will do so sequentially. This will end up allocating dynamic queues that reach a max size of two. It is possible to avoid a dynamic queue by writing a new Executor that only stores a single function, if that is too much of a performance cost. Reviewed By: yfeldblum Differential Revision: D7597731 fbshipit-source-id: cd8899e6c086ecff812050f7241e80f39c546706
-
Dan Melnic authored
Summary: Avoid creating a loop in the ThreadEntryList in onThreadExit Reviewed By: djwatson Differential Revision: D7632840 fbshipit-source-id: 409358aae16a8aed4ae654ebfeca994385b43a9e
-
Giuseppe Ottaviano authored
Summary: Neither GCC or Clang are able to optimize a `memcpy` where the length is known to be smaller than a word: a library call is generated. This is a simple implementation of a subword `loadUnaligned` to be used to read the tail of a buffer when reading one word at a time. Reviewed By: luciang Differential Revision: D7631978 fbshipit-source-id: d5719580e6bef82aa8e3fbdce8f873b569527a3a
-
- 16 Apr, 2018 9 commits
-
-
Adam Simpkins authored
Summary: This function is no longer used anywhere. Reviewed By: Orvid Differential Revision: D7597741 fbshipit-source-id: 296acfceb59293bbafc6f6bf9c67d951cf41f7be
-
Adam Simpkins authored
Summary: Update `make_temp_dir()` to use `shutil.rmtree()` to clean up rather than just `os.rmdir()`. If the function using this context manager throws it may leave behind files inside the temporary directory, and it is useful to always clean those up. Also update `read_fbcode_builder_config()` to work regardless of the current working directory. Previously this function only worked if the current working directory was the directory containing the configuration file. This makes sure that `read_fbcode_builder_config()` calls are always treated as relative to the directory containing the configuration file being read. Reviewed By: yfeldblum Differential Revision: D7597743 fbshipit-source-id: 817063104081336fcc0a9f825beb74d7d4377499
-
Marc Celani authored
Summary: Creates a new SlidingWindow data structure for general purpose use in stats code. Reviewed By: anakryiko Differential Revision: D7597047 fbshipit-source-id: 227438055029c2bacb5edf2943ebc9cc66fdfe36
-
Dan Melnic authored
Summary: Use unbounded queue in NotificationQueue (prev changes: D7164130, D7251343, D7278275, D7359322, D7471153, D7606076) Reviewed By: djwatson Differential Revision: D7408628 fbshipit-source-id: 04ae235d9b3de603e28115e11fe98fe7e9aa1f8c
-
Stephan authored
Summary: fixes #819. Closes https://github.com/facebook/folly/pull/820 Reviewed By: yfeldblum Differential Revision: D7642932 Pulled By: Orvid fbshipit-source-id: c49168ddf111c851d0218b74fbbdf405e9a68fc3
-
Kevin Doherty authored
Summary: - Expose an API to erase an item from `F14Set` and do something with it before it is destroyed - This includes (but is not limited to) being able to `std::move` it to another container while avoiding a copy - Change erase implementations to forward to `eraseInto(...args, emptyCallback)` Reviewed By: shixiao Differential Revision: D7588928 fbshipit-source-id: 5e9c2bda216c5c219c333282daadd2170e6a1eba
-
Subodh Iyengar authored
Summary: Adds the ability for UDP sockets to optionally listen to errors that happen on the socket, for example ICMP errors. In this iteration, we explicitly do not register for read events if an error callback is set. So even if you set an error callback to get error events you must register a read callback. Reviewed By: yfeldblum Differential Revision: D7632877 fbshipit-source-id: 43c922d0145e1da97b993f5bf4058c20d3469deb
-
Subodh Iyengar authored
Summary: Clang format files related to AsyncUDPSocket. This helps keep changes consistent. Reviewed By: yfeldblum, lnicco Differential Revision: D7632865 fbshipit-source-id: 0761f0cfd06417334e680ca0880280d65480fe7e
-
Yedidya Feldblum authored
Summary: [Folly] Tweak `SharedPromise` and `FutureSplitter` docs, in particular to reflection recent changes to execution semantics. Reviewed By: LeeHowes Differential Revision: D7630725 fbshipit-source-id: 68da70cd86d131aa09c1909d90a793868039e84f
-
- 14 Apr, 2018 6 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] All comparison predicates for `IOBuf`, not just `EqualTo`. Reviewed By: djwatson, stevegury Differential Revision: D7596700 fbshipit-source-id: 2d5cef2797dc75d4fb76c2d13e4a938f738da163
-
Yedidya Feldblum authored
Summary: [Folly] comparison-to-predicate adapters for comparisons which return `ordering`. Reviewed By: stevegury Differential Revision: D7596712 fbshipit-source-id: 1aeccf0d38eec27cfa88af2908f3114523d6b6b5
-
Yedidya Feldblum authored
Summary: [Folly] `to_ordering` to convert from `int` to `ordering`. Reviewed By: stevegury Differential Revision: D7596709 fbshipit-source-id: cf1316a7560b9398b94d1c834258f09a797a98f8
-
Yedidya Feldblum authored
Summary: [Folly] An `ordering` type, lifted from `FixedString`. Reviewed By: stevegury Differential Revision: D7596713 fbshipit-source-id: ba19e1e36e75b946e14f6db9c72ac1ac3c7270e9
-
Adam Simpkins authored
Summary: D7479058 changed the exception_tracer code to export their targets in the main folly-targets.cmake file, but I forgot to remove the `install()` command installing the old `folly-exception-tracer-targets.cmake` file. This would cause `cmake configure` to exit with an error if it detected it could built the exception_tracer code, but it would still generate all of the necessary Makefiles correctly, so subsequent `make` commands would still work. Reviewed By: yfeldblum Differential Revision: D7626710 fbshipit-source-id: f015032c3c42cf2911fcaf9b355fc97616ff20e1
-
Léonard Gérard authored
Summary: The cmake globbing then excluding strategy implies that if the directory in which we are compiling has a folder named `build` on its path like `/home/alice/project/build/folly/...`, everything breaks. Note that it is the same for `tools` and `test`, I also fixed the tools one, but the test once has many files.... Using a file list would be the real solution. Closes https://github.com/facebook/folly/pull/815 Reviewed By: simpkins Differential Revision: D7624035 Pulled By: yfeldblum fbshipit-source-id: a3f1d2f82e55e070d13acc5c394d8cfdfabeb7ed
-
- 13 Apr, 2018 2 commits
-
-
Marc Celani authored
Summary: The existing histogram approach for estimating quantiles is inadequate for common use cases. This diff introduces TDigests for estimating quantiles of streaming values. The current histogram approach suffers from two issues: - The user needs to know something about the universe of values, U, and the underlying distribution in order to get reasonably accurate values - Because the histogram is not biased, estimating tail quantiles such as p99.9 requires a large amount of memory. t-digests (https://github.com/tdunning/t-digest/blob/master/docs/t-digest-paper/histo.pdf) are biased digests that allow for accurate estimates of tail quantiles, while using a small amount of memory and without requiring the user to know anything about U. The scaling function in the paper is slow, because it uses arcsin. This approach uses a sqrt function instead. Details of why this works in the comments of the TDigest file. Reviewed By: simpkins Differential Revision: D7512432 fbshipit-source-id: 01460433ec7380fed88e5e942ef15f032dd794bb
-
Yedidya Feldblum authored
Summary: [Folly] Fix `constexpr` predicate names, which have embarrassing typos. Reviewed By: igorsugak Differential Revision: D7605352 fbshipit-source-id: e04a87fd375f09472b020380bf446c7236a39e51
-
- 12 Apr, 2018 5 commits
-
-
Dan Melnic authored
Summary: Fix broken Android build (Note: this ignores all push blocking failures!) Reviewed By: michalgr Differential Revision: D7606076 fbshipit-source-id: 0cf0426a34cf62b045acb932d42a8e4a3cd5da71
-
Tudor Bosman authored
Summary: When trying to compile `folly/experimental/exception_tracer` with gcc-7.2, I get the following error: ``` ExceptionCounterLib.cpp: In instantiation of '{anonymous}::throwHandler(void*, std::type_info*, void (*)(void*))::<lambda(auto:9&)> [with auto:9 = std::unordered_map<long unsigned int, folly::exception_tracer::ExceptionStats>]': ../../../folly/Synchronized.h:162:20: required from 'auto folly::SynchronizedBase<Subclass, (folly::detail::MutexLevel)1>::withWLock(Function&&) [with Function = {anonymous}::throwHandler(void*, std::type_info*, void (*)(void*))::<lambda(auto:9&)>; Subclass = folly::Synchronized<std::unordered_map<long unsigned int, folly::exception_tracer::ExceptionStats>, folly::RWSpinLock>]' ExceptionCounterLib.cpp:132:4: required from here ExceptionCounterLib.cpp:127:21: error: uninitialized variable 'info' in 'constexpr' function ExceptionInfo info; ^~~~ In file included from ../../../folly/experimental/exception_tracer/ExceptionCounterLib.h:22:0, from ExceptionCounterLib.cpp:16: ../../../folly/experimental/exception_tracer/ExceptionTracer.h:30:8: note: 'struct folly::exception_tracer::ExceptionInfo' has no user-provided default constructor struct ExceptionInfo { ^~~~~~~~~~~~~ ../../../folly/experimental/exception_tracer/ExceptionTracer.h:31:25: note: and the implicitly-defined constructor does not initialize 'const std::type_info* folly::exception_tracer::ExceptionInfo::type' const std::type_info* type; ^~~~ ``` Fixed by initializing `ExceptionInfo::type`. Compiling with gcc 7.2 now works. Closes https://github.com/facebook/folly/pull/812 Reviewed By: Orvid Differential Revision: D7598341 Pulled By: yfeldblum fbshipit-source-id: 0a8859b6d5f174484c8f2148de59a2a592dc2b25
-
Yedidya Feldblum authored
Summary: [Folly] Rename `IOBufEqual` to `IOBufEqualTo` to correspond with the standard naming of `std::equal_to`. Reviewed By: Orvid Differential Revision: D7596716 fbshipit-source-id: 2e87aa4b62a002520bdd53b5b7eaba7d9bd822da
-
kumagi authored
Summary: in Linux environment, `find_package(gflass)` searches `Findgflags.cmake`. And it cannot find https://github.com/facebook/folly/blob/master/CMake/FindGFlags.cmake , because linux is case-sensitive environment in filenames and cause error. ``` CMake Error at CMake/folly-deps.cmake:34 (message): Unable to determine the target name for the GFlags package. Call Stack (most recent call first): CMakeLists.txt:65 (include) ``` For linux programmers, this line should find `FindGFlags.cmake` file which exists in the same directory. Closes https://github.com/facebook/folly/pull/805 Reviewed By: yfeldblum Differential Revision: D7505908 Pulled By: Orvid fbshipit-source-id: c30097a25569d293df9a1bfecbee84cece260306
-
Yedidya Feldblum authored
Summary: [Folly] Function objects for performing `constexpr` comparisons for C++11 or gcc49. After upgrading to C++14 and dropping support for C++11, these may be removed because the corresponding function objects in the C++14 standard library are `constexpr`-invocable. Reviewed By: Orvid Differential Revision: D7590351 fbshipit-source-id: a8702115a66836aff25761f374b8a2d7dbe12074
-