1. 10 Apr, 2019 2 commits
    • Yedidya Feldblum's avatar
      Wait on the specified child in the rcu fork test · 41eed442
      Yedidya Feldblum authored
      Summary: [Folly] Wait on the specified child in the rcu fork test, v.s. waiting on any child. Makes the test more exact.
      
      Differential Revision: D14869269
      
      fbshipit-source-id: 2bb0110e5097f1dfe21602a09893a33e92421555
      41eed442
    • Doron Roberts-Kedes's avatar
      Introduce SIMDTable for ConcurrentHashMapSegment · 8ad6b845
      Doron Roberts-Kedes authored
      Summary:
      As an alternative to backend to BucketTable, introduce SIMDTable, which mimics the use of SSE intrinsics to filter tags as found in F14 code.
      
      On synthetic benchmarks, SIMDTable outperforms BucketTable by between 1.1x and 2.6x operations per second when the map does not fit in cache. However, when the map fits in cache SIMDTable executes around 10% fewer operations per second compared with BucketTable.
      
      BucketTable, the existing backend, remains the default.
      
      Reviewed By: djwatson
      
      Differential Revision: D14458269
      
      fbshipit-source-id: 5b6b01db5eb2430bdfc6f3500458f25971a6ad3d
      8ad6b845
  2. 09 Apr, 2019 12 commits
    • Yedidya Feldblum's avatar
      Handle Clang on Windows in pretty_name · 1060fb28
      Yedidya Feldblum authored
      Summary: [Folly] Handle Clang on Windows in `pretty_name`.
      
      Reviewed By: Orvid
      
      Differential Revision: D14844690
      
      fbshipit-source-id: 1f995604d5be0cd571caa344e5b18f877188390d
      1060fb28
    • Alejandro Mallea's avatar
      Removes unused function for non-MS compilers. · 47b5e69f
      Alejandro Mallea authored
      Summary:
      When building without Microsoft Visual C++, `do_nothing` is not used
      at all, potentially triggering unused function warnings, which makes it useless
      to compile with strict flags such as `-Wall -Werror`.
      
      Reviewed By: yfeldblum, aary
      
      Differential Revision: D14843227
      
      fbshipit-source-id: 28f0041ccae8bf07dc1f3e41e1cf67291c3d8447
      47b5e69f
    • Orvid King's avatar
      Fix Folly for C++ p0482 · 3621a2f9
      Orvid King authored
      Summary:
      TLDR; The element type of a utf8 string literal was changed from a `char` to a `char8_t`, which are incompatible. There is a paper that aims to resolve some of these issues, but the next version of MSVC has already implemented p0482, so we need to add a workaround for now.
      
      Fixes: https://github.com/facebook/folly/issues/1102
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14856705
      
      fbshipit-source-id: 983548cb0cb210341ec55d9dcdc63e726bfe4f62
      3621a2f9
    • Adam Norton's avatar
      Fix WindowTests · 70ebf75b
      Adam Norton authored
      Summary: `collect` short-circuits on an exception, so we need to wait for all the callbacks before deallocating the captured state
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14818841
      
      fbshipit-source-id: e7af2965b7641feff1e4230a6a66c7860994f826
      70ebf75b
    • Nathan Bronson's avatar
      add missing FOLLY_ALWAYS_INLINE to F14Map erase · 2b546a7a
      Nathan Bronson authored
      Summary:
      F14Map::erase(it) returns ++it for compatibility, but it
      is often discarded. erase(const_iterator) was marked always-inline to
      enable the computation of the return value to be optimized away, but the
      annotation was missing from erase(iterator).  This also adds always-inline
      annotations to a couple more methods that participate in the optimization,
      but they are very good candidates for inlining regardless.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14854278
      
      fbshipit-source-id: ad686b2dc8996b6a7c7038653a7c9ea1567e554d
      2b546a7a
    • Long Cheng's avatar
      Delete duplicated tests · b49e3a58
      Long Cheng authored
      Summary: Appear to be leftover from D8683752
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14854252
      
      fbshipit-source-id: bef87438201f9292fb0e5c62222d1a248163eda2
      b49e3a58
    • Doron Roberts-Kedes's avatar
      folly: Move reusable f14 code into F14Mask.h · 9bcd9d44
      Doron Roberts-Kedes authored
      Summary: Reusable mask/iter code moves into folly/container/detail/F14Mask.h. This is in preparation for reuse by SIMDTable in ConcurrentHashMap.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14729170
      
      fbshipit-source-id: fbf5e10a13eeb5e964f52d4fe262f9e5ae2e8f73
      9bcd9d44
    • Doron Roberts-Kedes's avatar
      Refactor folly::ConcurrentHashMapSegment to delegate internal work to BucketTable impl_ member · 6e6f1db2
      Doron Roberts-Kedes authored
      Summary:
      This sets the stage for D14458269, which adds a 2nd possible ImplT class.
      
      Move code shared between ImplT's into shared area.
      
      Work done in *_internal functions and functions that access member fields other than `batch_` now goes into this impl_ member.
      
      ConcurrentHashMapSegment basically is now just a wrapper that knows how to translate things like emplace, try_emplace, assign, etc. to various flavors of insert_internal. Changes to erase control flow are analogous.
      
      Reviewed By: davidtgoldblatt
      
      Differential Revision: D14458241
      
      fbshipit-source-id: 41d103141ead1eb306b6fe863932f00f827f68c3
      6e6f1db2
    • Joe Loser's avatar
      Fix deduction guide macro guard for Replaceable (#1097) · 5caa4e1d
      Joe Loser authored
      Summary:
      - `Replaceable` defines a deduction guide if the feature test macro for
        it is met, or if we are on MSVC. However, the MSVC version that folly
        supports also defines the feature test macro for deduction guides. As
        such, remove the extra check for MSVC.
      - Add `ReplaceableTest` to the  cmake build.
      - Add test for deduction guide.
      Pull Request resolved: https://github.com/facebook/folly/pull/1097
      
      Reviewed By: Orvid
      
      Differential Revision: D14699047
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: ee62bae0f4b05f1a110c2bd90470fecbb0666d24
      5caa4e1d
    • Yedidya Feldblum's avatar
      kIsClang · abc7ab99
      Yedidya Feldblum authored
      Summary: [Folly] `kIsClang`.
      
      Reviewed By: Igman
      
      Differential Revision: D14844691
      
      fbshipit-source-id: 80a738d5925d6d61e69f38ef5b43bf47691d233a
      abc7ab99
    • Orvid King's avatar
      Fix build of DistributedMutex · 9a38d122
      Orvid King authored
      Summary:
      It was broken, fix it.
      
      Fixes https://github.com/facebook/folly/issues/1092
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14842180
      
      fbshipit-source-id: 899c95fdac3622c78c9c6f326cd14898007ddf6c
      9a38d122
    • Orvid King's avatar
      Remove the fd overloads of AsyncPipe components · 845936ce
      Orvid King authored
      Summary: They're dead
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14838871
      
      fbshipit-source-id: 4b136d7a5914a1564f32bb87e6bec2b8d1411829
      845936ce
  3. 08 Apr, 2019 6 commits
    • Eric Niebler's avatar
      Simplify constraints on operator co_await for SingleTypedSenders · fab6cad7
      Eric Niebler authored
      Summary: Because of the guard against constraint recursion in the definition of `struct awaitable_sender_traits` (awaitable/concepts.h, line 75), there is no need to be so conservative with the constraints of the generic `operator co_await` for `SingleTypedSender`s.
      
      Reviewed By: kirkshoop
      
      Differential Revision: D14816672
      
      fbshipit-source-id: b2f49588ae98ea63a24f4044692470c59be15e29
      fab6cad7
    • Orvid King's avatar
      Remove the fd overload of EventHandler::EventHandler · 85525f39
      Orvid King authored
      Summary: Things have been ported, time to remove the fd version.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14703143
      
      fbshipit-source-id: 13498d5a4c20d19c30c0d0fe942c5d62bb99aa08
      85525f39
    • Wez Furlong's avatar
      Back out "folly: cmake: enable DistributedMutexTest.cpp" · a96c8c4f
      Wez Furlong authored
      Summary:
      I only enabled this speculatively, but since it quite a heavyweight
      test, it is timing out in the open source build, so let's turn it off again.
      
      Reviewed By: lewissbaker
      
      Differential Revision: D14817162
      
      fbshipit-source-id: 343b021890974e5b92975bdfc7b4fa554d20a703
      a96c8c4f
    • Wez Furlong's avatar
      oss: FindLibEvent.cmake: workaround cmake POLICY annoyances · f39f7560
      Wez Furlong authored
      Summary:
      When pulled in as an external project into an environment
      that has changed the default cmake policy, the trick we're using
      to extract the full library path errors out.  This works around
      that issue by saving the policy settings and then setting them
      how we need them before restoring them after we're done.
      
      refs https://github.com/facebook/folly/issues/1100
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14766991
      
      fbshipit-source-id: e2506bc0aebd9e66bc70b12c4c538c9e034f9f73
      f39f7560
    • Orvid King's avatar
      Shift AsyncPipe to NetworkSocket · a484a114
      Orvid King authored
      Summary:
      Shift AsyncPipe to be backed by NetworkSocket, as the only things this can be used for are listenable to by libevent. At the moment, the APIs for what are listenable to by libevent are all described in terms of NetworkSocket.
      While, by name, this may seem incorrect, in practice, it is correct in function, due to the limitations of how NetworkSocket's are obtainable on Windows, and all existing calls to these functions on posix platforms are already functional by being file descriptor backed.
      The plan is to have this, slightly badly named for the location, interface for the moment, and to clean it up in the future.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14702972
      
      fbshipit-source-id: 785281a7bb9fafc63f5295e33f5bc136b9bc70f1
      a484a114
    • Yedidya Feldblum's avatar
      Lower quadratic iteration count in an elias-fano test · dbff71d2
      Yedidya Feldblum authored
      Summary: [Folly] Lower quadratic iteration count in an elias-fano test to make it take less wall time to run.
      
      Reviewed By: philippv
      
      Differential Revision: D14821341
      
      fbshipit-source-id: 726fe5bd17442661196593ea6279314509622832
      dbff71d2
  4. 07 Apr, 2019 1 commit
  5. 06 Apr, 2019 3 commits
  6. 05 Apr, 2019 11 commits
    • Orvid King's avatar
      Remove fd overload of AsyncServerSocket::useExistingSocket · a89579c3
      Orvid King authored
      Summary: All calls have been converted to the NetworkSocket overload
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13566829
      
      fbshipit-source-id: c6a3b155ffe35534c0297eba7819413e4ce77282
      a89579c3
    • Yedidya Feldblum's avatar
      Cut fbcode_builder dep for thrift on krb5 · 2105cec0
      Yedidya Feldblum authored
      Summary: [Thrift] Cut `fbcode_builder` dep for `thrift` on `krb5`. In the past, Thrift depended on Kerberos and the `krb5` implementation for its transport-layer security. However, Thrift has since migrated fully to Transport Layer Security for its transport-layer security and no longer has any build-time dependency on `krb5`. Clean this up.
      
      Reviewed By: stevegury, vitaut
      
      Differential Revision: D14814205
      
      fbshipit-source-id: dca469d22098e34573674194facaaac6c4c6aa32
      2105cec0
    • Lewis Baker's avatar
      Add folly::coro::collectAll[Try]Range() · 699acb25
      Lewis Baker authored
      Summary:
      Add functions for concurrently awaiting a collection of SemiAwaitable objects.
      
      * `folly::coro::collectAllRange()` takes an InputRange of SemiAwaitable objects and concurrently awaits them, producing a `std::vector` of the results. This will throw an exception if any of the input operations failed with an exception.
      * `folly::coro::collectAllTryRange()` takes an InputRange of SemiAwaitable objects and concurrently awaits them, producing a `std::vector<folly::Try<T>>` containing the results. Failure of individual operations can be determined by inspecting the corresponding `Try` value.
      
      This diff also refactors the existing implementations of `folly::coro::collectAll()` to make use of a new `Barrier` and `BarrierTask` implementation detail rather than using `DetachedInlineTask`, `Baton` and an atomic counter. This allows delaying the start of the child corouines until after all coroutines have been created which was necessary for cases where we didn't know the number of elements in the input range to allow storage for the results to be allocated in a vector before the tasks start producing results.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D14430147
      
      fbshipit-source-id: 5ba4b7cdc3c9b65d1736f14a2d39f7beb6cb82b0
      699acb25
    • Orvid King's avatar
      Remove the fd overload of AsyncServerSocket::getSocket · 1290f5f2
      Orvid King authored
      Summary: It's dead.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14191959
      
      fbshipit-source-id: 8cfb68fa8f10b1f847bf6601aec8d869cb9c008d
      1290f5f2
    • Eric Niebler's avatar
      rename many_sender to simply sender · fbc1a619
      Eric Niebler authored
      Summary: To reflect the fact that the concept `SingleSender` is a refinement of `Sender` (there is no "`ManySender`"), rename `(any_)?(flow_)?many_sender` to `(any_)?(flow_)?sender`.
      
      Reviewed By: kirkshoop
      
      Differential Revision: D14803648
      
      fbshipit-source-id: 5987ebe5ba877d0a3ab38e84b036f97302bcc70b
      fbc1a619
    • Eric Niebler's avatar
      reorganize pushmi headers · bb73ffc6
      Eric Niebler authored
      Summary:
      The pushmi library has grown to the point where a little more structure would aid comprehensibility.
      
      Also, finer-grained headers and build targets would make it easier for downstream projects to include only what they absolutely need.
      
      Reviewed By: kirkshoop
      
      Differential Revision: D14802895
      
      fbshipit-source-id: 8d253f97c5d0529530cc3b7110505000f513ce83
      bb73ffc6
    • Adam Norton's avatar
      Avoid executor re-queue in collect[All]SemiFuture · 8e5c2b92
      Adam Norton authored
      Summary:
      This is a performance optimization to avoid an executor re-queue for the collect[All] continuations which just move the result.
      
      The biggest problem with this now is that these futures are often on a thread pool backed with a blocking MPMCQueue which means the add can potentially deadlock. This diff is not meant as a true fix to the problem though; just an improvement.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14754908
      
      fbshipit-source-id: e533bfa6b9d2d820d50422b612c1489b560ec9d5
      8e5c2b92
    • Yedidya Feldblum's avatar
      PriorityUnboundedBlockingQueue · 4fa5101b
      Yedidya Feldblum authored
      Summary: [Folly] `PriorityUnboundedBlockingQueue`, paralleling `UnboundedBlockingQueue` and `PriorityLifoSemMPMCQueue`.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D14536886
      
      fbshipit-source-id: b3ea04c3f67d3e1e9d80626d963be70de1ae79ba
      4fa5101b
    • Yedidya Feldblum's avatar
      Cut traits for old-ABI std::basic_string · d48cea50
      Yedidya Feldblum authored
      Summary: [Folly] Cut traits for old-ABI `std::basic_string` under libstdc++.
      
      Reviewed By: pixelb
      
      Differential Revision: D14764155
      
      fbshipit-source-id: fa4991f4b70fb407672212886c84f1be4c33581f
      d48cea50
    • Lee Howes's avatar
      Add executor-taking forms of deferValue and thenValue · c316166d
      Lee Howes authored
      Summary: For consistency adds thenExValue and deferExValue.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14793864
      
      fbshipit-source-id: 700f02cfb27b93e1739c511f01142c30c1896990
      c316166d
    • Chad Austin's avatar
      fix dynamic linking of stats on macOS · 57cc7e45
      Chad Austin authored
      Summary:
      D14531266 defaulted static linking on macOS because of a link error in
      folly/stats. A better fix for the issue is instantiating the
      subclasses of BufferedStat, so add those.
      
      Reviewed By: andrewjcg
      
      Differential Revision: D14767345
      
      fbshipit-source-id: eaa597dec468264595547f338348d7d74b49dd69
      57cc7e45
  7. 04 Apr, 2019 5 commits
    • Lee Howes's avatar
      Rename defer for an executor-taking continuation deferExTry for consistency with thenExTry · a9ab61b4
      Lee Howes authored
      Summary: Renames defer taking an executor-taking continuation to deferExTry and modifying to take a KeepAlive for consistency with thenExTry.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14761230
      
      fbshipit-source-id: af95afabb662197edcf2eeb432bc64c57011c776
      a9ab61b4
    • Eric Niebler's avatar
      make awaitables sender and make single-typed senders awaitable · dad6c2b8
      Eric Niebler authored
      Summary:
      Add coroutine support to pushmi by making all sender types that satisfy the `SingleTypedSender` concept awaitable; that is, you can get their result by `co_await`-ing them in a coroutine.
      
      In addition, all Awaitable types automatically satisfy the `SingleTypedSender` concept; that is, you can pass them to `pushmi::submit` along with a `Receiver` that is invoked with the result of `co_await`-ing the awaitable.
      
      Reviewed By: kirkshoop
      
      Differential Revision: D14688373
      
      fbshipit-source-id: 8598b303aebcaa070033868abd440245c165bd73
      dad6c2b8
    • Eric Niebler's avatar
      replace receiver properties with receiver_traits · 432d4332
      Eric Niebler authored
      Summary: Types opt in to receiver-ness with pushmi::receiver_traits, analogous to sender_traits (and std::iterator_traits). Alternatively, they can simply define a nested ::receiver_concept typedef that is an alias for one of "sink" or "flow".
      
      Reviewed By: kirkshoop
      
      Differential Revision: D14668335
      
      fbshipit-source-id: 230abfcffef0cd231196b5f6a7ed05e1ac86ef0c
      432d4332
    • Eric Niebler's avatar
      add TypedSender support to pushmi, pave the way for Awaitable senders · 1c1fbc3c
      Eric Niebler authored
      Summary:
      * The sender concepts are now defined in terms of a `sender_traits` class template, in which the user can specify additional sender metadata like what values and errors it sends to the Receiver. This will make it possible to automatically make Senders awaitable from within coroutines.
      
      * Remove the now-unused is_sender<>, is_single<>, and is_many<> properties.
      
      * Define a `SingleSender` concept and a `TypedSender` concept.
      
      * Define a `pushmi::sender` class template from which a Sender can inherit to declare the sender category (single/many/flow), and the types of the values and errors.
      
      Reviewed By: kirkshoop
      
      Differential Revision: D14631770
      
      fbshipit-source-id: afcfd10bcd4e0e7ba224ea2c713d7fa92249ab7f
      1c1fbc3c
    • Andrii Grynenko's avatar
      Add a comment. · 7bcdd925
      Andrii Grynenko authored
      Reviewed By: lbrandy
      
      Differential Revision: D14766712
      
      fbshipit-source-id: 78c84117aa1c35825c72eb4bcd04e0bebb20c67f
      7bcdd925