- 02 Sep, 2019 1 commit
-
-
Lee Howes authored
Summary: Remove calls to Future::then(executor, callback). This form of Future::then is ambiguous, and does not yet implement the stronger typing of thenValue and thenTry. It is also tempting to use instead of via, where it is not obvious that it has the behaviour of wrapping a via call in a push and pop of the current executor: .pushCurrentExecutor().via(executor).then(callback).popCurrentExecutor(). With the addition of inline continuations, we can instead make the nesting explicit at low cost by making it an inline continuation that launches an asynchronous task on the passed executor. Reviewed By: yfeldblum Differential Revision: D15100419 fbshipit-source-id: e929e2eaf2fc30313cb099150be3a9535ae729a6
-
- 01 Sep, 2019 1 commit
-
-
Lee Howes authored
Summary: TimeKeeper::after and TimeKeeper::at return Futures that for the majority of implementations complete on a TimeKeeper owned executor. This can lead to problems. Consistent with other API cleanups, this diff switches TimeKeeper APIs to return SemiFuture, requiring that the caller attach an explicit executor when work is to be scheduled downstream of the TimeKeeper. Reviewed By: yfeldblum Differential Revision: D17005944 fbshipit-source-id: 98d7e8aaf1ad40ce2180503f632f2f0003bb12be
-
- 31 Aug, 2019 3 commits
-
-
Lee Howes authored
Summary: Under some circumstances the DeferredExecutor might already have nested executors and this code adds more. Both incoming futures should instead nest within a fresh DeferredExecutor returned that is part of the SemiFuture from the operation. Reviewed By: mpark Differential Revision: D17121117 fbshipit-source-id: b4507bf5d7b0c98e5e5de6f73ff4bd3e2790374c
-
Yedidya Feldblum authored
Summary: [Folly] RTM re-nits for `xabort`. * Remove param pack. * Always noreturn. Reviewed By: nbronson Differential Revision: D17117350 fbshipit-source-id: b16056b1f02956d334da4494c689a4b988a961d4
-
Kirk Shoop authored
Summary: The `materialize()` algorithm meterializes values from a stream into a stream of events that represent each value and also the end-of-stream and stream-error events. `dematerialize()` reverses a materialized stream by replaying the events recorded in the input stream to an output stream. Reviewed By: lewissbaker Differential Revision: D16772236 fbshipit-source-id: 27de543ea2d02691a376fd0f11d0113c5c39287d
-
- 30 Aug, 2019 8 commits
-
-
Wez Furlong authored
Summary: boost.fiber is not available on macos and is required by fbzmq, so disable the build on darwin. In D17128935 I tried to make libzmq build with cmake to build on windows, but there's a problem with its cmake and it fails to configure. So let's just nop out the build for !linux for now. Reviewed By: jstrizich Differential Revision: D17129362 fbshipit-source-id: db89010d18707a4105b8d395b1758f738336495d
-
Paul O'Shannessy authored
Summary: In order to foster healthy open source communities, we're adopting the [Contributor Covenant](https://www.contributor-covenant.org/). It has been built by open source community members and represents a shared understanding of what is expected from a healthy community. Reviewed By: josephsavona, danobi, rdzhabarov Differential Revision: D17104640 fbshipit-source-id: d210000de686c5f0d97d602b50472d5869bc6a49
-
Adam Simpkins authored
Summary: This module provides a `add_fbthrift_library()` convenience function that can be used to generate thrift libraries for multiple languages with a single call. Reviewed By: wez Differential Revision: D16742275 fbshipit-source-id: c13120cf9e051629951282141eb22f3e085782f9
-
Adam Simpkins authored
Summary: This module helps generate Python libraries from thrift files. It is the Python equivalent of `FBThriftCppLibrary.cmake` Reviewed By: wez Differential Revision: D16742274 fbshipit-source-id: ef0dc7f24eb1c7375d2587ee6b71fd25bd6f35a7
-
Adam Simpkins authored
Summary: Fix a minor bug in the argument parsing for `add_fbthrift_cpp_library()`: only a single value should be supplied for the `THRIFT_INCLUDE_DIR` argument. This parameter should not accept a list of arguments. Reviewed By: strager Differential Revision: D17125810 fbshipit-source-id: 31f354e4d6299d3626a94f3b4b5ff8c58bb0cf7b
-
Lewis Baker authored
Summary: An AsyncGenerator coroutine now has an implicit associate CancellationToken that is inherited from the calling context of each `co_await gen.next()` call. This means that generators that correspond to long-running subscriptions now have an in-built channel that allows them to cancel the subscription. This is also useful for algorithms that introduce concurrency in processing of stream data. eg. The `buffer()` or `merge()` algorithms. Reviewed By: kirkshoop Differential Revision: D16833864 fbshipit-source-id: be8faf1ec438c4248091e02d6a264d3760e2d73d
-
Uladzislau Paulovich authored
Summary: Pull Request resolved: https://github.com/facebook/folly/pull/1212 MSVC has a bug and can't match definitions of some of the constructors to the corresponding declarations in a class body. This diff workarounds the bug by inlining constructors. Reviewed By: LeeHowes Differential Revision: D17119718 fbshipit-source-id: eb7a9d4916b962c718d047eb0ee7fa4a9761776e
-
Lewis Baker authored
Summary: The `collectAll()`, `collectAllRange()` and `collectAllWindowed()` functions now cancel their subtasks when either the parent task is cancelled or when any of the subtasks fail with an exception. The `collectAllTry()`, `collectAllTryRange()` and `collectAllTryWindowed()` functions now cancel their subtasks if the parent task is cancelled, but not if the child tasks fail with an exception. The logic between the distinction here is that if you are calling one of the 'try' functions then you are intending to handle partial failure and so probably want each of the operations to run to completion independently of the others. Reviewed By: kirkshoop Differential Revision: D16820619 fbshipit-source-id: 5c203b41592a0145ff7be1c609dfccd39c41a3df
-
- 29 Aug, 2019 10 commits
-
-
Uladzislau Paulovich authored
Summary: `clang-cl` on Windows also defines `__PRETTY_FUNCTION__` which has a format different from `__FUNCSIG__`. Therefore folly breaks users of this macro. Alias should be defined only when "real" MSVC compiler is used. Reviewed By: akrieger, Orvid, blackm00n Differential Revision: D17094657 fbshipit-source-id: 4b191a61201704382e6b6e178bcc1c673511c537
-
Adam Simpkins authored
Summary: Rename the `ThriftCppLibrary.cmake` file to `FBThriftCppLibrary.cmake`, and also rename `add_thrift_cpp2_library()` to `add_fbthrift_cpp_library()`. Explicitly calling this `fbthrift` helps clearly distinguish that this is intended for use with fbthrift (https://github.com/facebook/fbthrift/), as opposed to Apache thrift. Reviewed By: wez Differential Revision: D16738440 fbshipit-source-id: 9b255e06b71c98ad74a34989f564a211958dcdd5
-
Nathan Bronson authored
Summary: CacheLocality's parsing code for /proc/cpuinfo doesn't properly handle systems in which there are offline CPUs. This diff makes it so we fall back onto the sequential cache locality implementation in the problematic scenarios. This should address https://github.com/facebook/folly/issues/1208 Reviewed By: shixiao Differential Revision: D17093176 fbshipit-source-id: 4da3a9dc53622f829af37ed70a2531c66fd92ddb
-
Aaryaman Sagar authored
Summary: Use folly::cacheline_align_v to prevent failures when running folly on platforms where extended alignment is not supported. The thread pools only used extended alignment as an optimization; so it is safe to disable it when not needed Reviewed By: yfeldblum Differential Revision: D17077439 fbshipit-source-id: 63ba59aaf7ce45231bb25427af84292c3a3464a9
-
Haijun Zhu authored
Summary: The non-atomic field `inUse_` is protected by a lock in `getStackCache`, but not in `giveBack`. This is a data race and it is caught by TSAN. Reviewed By: yfeldblum Differential Revision: D17109710 fbshipit-source-id: 7c0d5d948740516422efca0895a702566c804bb4
-
Wez Furlong authored
Summary: Windows and macOS compilers are sensitive to this, and this was overlooked in D16636130 Reviewed By: selat Differential Revision: D17113825 fbshipit-source-id: 16fe9210b07a096a58f3370df64874514e28ea46
-
Nick Sukhanov authored
Summary: Compiler passes rvalue reference for named local variable to return_value: https://reviews.llvm.org/D51741 Reviewed By: lewissbaker Differential Revision: D16963353 fbshipit-source-id: 98d846153adb2235b61bb8fb54d10f032d4c0055
-
Joe Loser authored
Summary: - Prior to commit 8cb615a2 (Differential Revision: D3394612), `Range:size()` had an assert checking that the beginning iterator of the range is less than or equal to the end iterator. Unfortunately, due to GCC bug 71448, the `assert` was not allowed if we wanted `size()` to remain a `constexpr` function. - This bug is no longer an issue with our current supported versions of GCC. As such, add the assert back in. Pull Request resolved: https://github.com/facebook/folly/pull/1155 Reviewed By: ericniebler Differential Revision: D15641627 Pulled By: yfeldblum fbshipit-source-id: 0677053c18fa55aaa4727947c241f0675362861b
-
Adam Simpkins authored
Summary: Update install_fb_python_library() to work with CMake versions older than 3.7. Previously the code used a generator expression in the directory argument supplied to `install(DIRECTORY)`. Support for generators in this parameter was only added in CMake 3.5, but it was buggy and did not correctly handle absolute paths until 3.7. This updates the code to avoid using a generator expression. This does require that the corresponding `add_fb_python_library()` statement appear before the `install_fb_python_library()` statement, but this seems like a pretty reasonable restriction. Reviewed By: chadaustin Differential Revision: D17103597 fbshipit-source-id: 54d6af93a3f530373cfe3137db99436d8484f308
-
Yedidya Feldblum authored
Summary: [Folly] RTM nits. * No nested namespace. * All status values supported. * Tests included in cmake builds. * API functions avoid `SIGILL` at runtime. Reviewed By: nbronson Differential Revision: D16636130 fbshipit-source-id: 9f9dc99b0826abbda295b069eb4823b3416af5d1
-
- 28 Aug, 2019 17 commits
-
-
Aaryaman Sagar authored
Summary: This is a useful testing utility that people can use if they use timeout APIs like `folly::futures::sleep()` Reviewed By: LeeHowes Differential Revision: D17065352 fbshipit-source-id: f9ea8366af7fc9429bfb1065328ed746c824f810
-
Mark Santaniello authored
Summary: The sorted vector types have constructors which "steal" capacity from a pre-filled container. Add tests to cover the cases where this is a folly:small_vector, and a std::pmr::vector. Reviewed By: nbronson Differential Revision: D17074150 fbshipit-source-id: e94b7e136553653081abe86559c4c013b9aac031
-
Lewis Baker authored
Summary: Adds static factory `CancellationSource::invalid()`. This can be used to construct a `CancellationSource` that can't be cancelled but that doesn't perform any heap-allocations. Reviewed By: kirkshoop Differential Revision: D16816764 fbshipit-source-id: bb87273903a6a8d245d207f4e6bda94e5c3d3dad
-
Lee Howes authored
Summary: Tweak futures::within to be completely deferred, including the timeout path, allowing it to support a SemiFuture-returning TimeKeeper. Reviewed By: yfeldblum Differential Revision: D17006080 fbshipit-source-id: cbed58579d33f6d6ecf60dce5f9c8b886fc4d4c4
-
Chris Keeline authored
Summary: wait() is guaranteed to succeed and not throw for either Baton type, so using a reference here is safe. When the future is completed on another thread, the shared_ptr causes cache contention. ``` Thread 1 Thread 2 make_shared/inc inc ... dec ref dec ref/free ``` Reviewed By: yfeldblum Differential Revision: D17077672 fbshipit-source-id: a6010ed159353decefbd5c51f4347370b16f7f60
-
Adam Simpkins authored
Summary: Update the generated `run_cmake.py` script to use `os.execve()` rather than `subprocess.call()`, so that it now propagates CMake's return code back to its caller. Reviewed By: chadaustin Differential Revision: D17089206 fbshipit-source-id: e01f05f492ccb842d4967e59fd0bc9a3e59b8a42
-
Adam Simpkins authored
Summary: Fix printing the manifest context in the error message if we cannot find a project fetcher. Previously the context in the message would be printed as something like `<getdeps.manifest.ManifestContext object at 0x7fcce987e610>`, now it shows instead as something like `{distro=ubuntu, distro_vers=18.04, fb=off, os=linux, test=off}` Reviewed By: chadaustin Differential Revision: D17089208 fbshipit-source-id: c16549b61030d813b7b5ff9f65966436dc1e1898
-
Adam Simpkins authored
Summary: This just strips off a trailing '/' from the `INSTALL_DIR` property that we set on python targets, to avoid having double-slashes in the paths that we use during installation. This shouldn't really have any material difference other than cleaning up the paths that get printed during the installation phase. Reviewed By: chadaustin Differential Revision: D17089207 fbshipit-source-id: ab36bb76c19fa60fe037f7a5290ccfd6bdbf13b0
-
Adam Simpkins authored
Summary: Update fboss to use `ThriftCppLibrary.cmake` directly from fbcode_builder rather than maintaining its own copy of this file. Reviewed By: chadaustin Differential Revision: D17005421 fbshipit-source-id: a64df426118df6088b47f09410dad7b8b7e79a43
-
Adam Simpkins authored
Summary: Update `add_thrift_cpp2_library()` to pass in the correct `-I` flags when invoking the thrift compiler so that it can find all of the other thrift files that this library depends on. D16062657 was a previous attempt to do this, but suffered from a few problems: - It required all dependencies to be defined before `add_thrift_cpp2_library()` was called. This requires users to carefully order their CMake files and subdirectory include ordering. - It only handled one level of dependencies, and did not propagate include paths for deeper dependencies. - It set the include path for dependencies to the source directory path where the dependency was originally built, rather than the directory where the thrift file for that dependency would be installed. This change does require CMake 3.8+. Previous versions of CMake do not support using generator expressions to generate multiple arguments for a custom command. Reviewed By: strager Differential Revision: D17005381 fbshipit-source-id: 31190beba94b4d1010445375a5e2791450230f7d
-
Lee Howes authored
Summary: Allow futures::when to pass through a SemiFuture-returning function. Reviewed By: yfeldblum Differential Revision: D17001974 fbshipit-source-id: dbe8b347f0a4c3fd19774c68c4e58e3b523b971f
-
Lee Howes authored
Reviewed By: yfeldblum Differential Revision: D17086382 fbshipit-source-id: 318834a1d82025bc0c34bcf7a95fedfffdb02ddb
-
Lee Howes authored
Summary: times is hard to use with SemiFutures, leading to potential use of inline executors just to make it work. This adds native support. Reviewed By: yfeldblum Differential Revision: D16992774 fbshipit-source-id: 483110d923ca51e037439ccc80173ffa9299cd64
-
Dan Melnic authored
Summary: Use FOLLY_CL_USE_FOLLY_TLS for CacheLocality to avoid an iOS build issue Reviewed By: mzlee Differential Revision: D17085507 fbshipit-source-id: acd407c9e0045eb4d8a59348a20874dbe75fd651
-
Lee Howes authored
Summary: Earlier change to duration waiting broke propagation of the interrupt handler. This change correctly propagates it into the new future that is returned. Reviewed By: yfeldblum Differential Revision: D17061618 fbshipit-source-id: b228221acbfab3ae94118c1197a485e01aa2e41e
-
Lee Howes authored
Summary: whileDo is hard to use with SemiFutures, leading to potential use of inline executors just to make it work. This adds native support. Reviewed By: yfeldblum Differential Revision: D16988569 fbshipit-source-id: abaf36180d6ff8a5277eebb277f7f0a254315d36
-
Alex Eckert authored
Summary: All of the requisite headers are now open sourced and eden has been converted to use them. This removes any logic that references this directory and kills the now unused cmake file. Reviewed By: chadaustin Differential Revision: D16994732 fbshipit-source-id: 573b8b50540ee64590682be2a54aa94659f12368
-