Questions tagged [folly]

Folly ("Facebook Open Source Library") is a C++ library of relatively low-level components, with very few dependencies, developed by Facebook. It's published under the Apache 2.0 license and is under active development as of November 2015.

folly is a C++ library of relative low-level components, developed by Facebook. It's published under the Apache 2.0 license and is under active development as of November 2015.

Among its feature one can find bit manipulation code snippets, an atomic hash map, Andrei Alexandrescu's ScopeGuard mechanism, and many more.

The library professes to complement the C++ Standard Library and Boost, i.e. avoid duplicate functionality with them.

See the overview of the library, or go to its github root.

68 questions
1
vote
2 answers

How to add a folly function with arguments into an folly executor?

I am trying to add some normal jobs which are folly::Function in folly::ThreadedExecutor. However, it appears that folly::ThreadedExecutor only provide interface to accept folly::Function. How could I add a function with arguments and…
蔡岳霖
  • 49
  • 1
  • 6
1
vote
0 answers

Q:facebook folly::future,compile failed

I just write like this: #include using folly::Promise; int main() { Promise p; return 0; } However,fail,giving this message: In function `folly::exception_wrapper::exception_wrapper()': error:…
aria2018
  • 11
  • 2
1
vote
1 answer

How do you append objects in Folly Dynamic?

How do you append values in to the dynamic object? If I do this : Metrics["something"] = folly::dynamic::object("yet", 25); Metrics["something"] = folly::dynamic::object("Notyet", 255); I am getting { "something" : { "Notyet" : 255 …
ajax_velu
  • 286
  • 3
  • 16
1
vote
1 answer

How does Facebook folly::AccessSpreader work?

Here is the code for AccessSpreader from the Facebook Folly library: https://github.com/facebook/folly/blob/master/folly/concurrency/CacheLocality.h#L212 /// AccessSpreader arranges access to a striped data structure in such a /// way that…
ulak blade
  • 2,515
  • 5
  • 37
  • 81
1
vote
0 answers

Proxygen http client using a connection pool (keep-alive)

I am writing a proxygen server that needs to make http request to other service. I would like to have a connection pool to this other service (using keep-alive), and whenever I need to make a request to this service, I would like to peak one of…
1
vote
1 answer

SDL2 program linked against jemalloc crashes on Mac os x but not ubuntu

I followed this tutorial and set up a very simple opengl progam using SDL2. I removed parts of it for purposes of this question. The program opens a window, sets the background color to be red, and loops until the escape key is pressed. #include…
Ryan Stout
  • 1,038
  • 6
  • 13
1
vote
2 answers

Template function type casting at run time for json deserialization

I want to write a function which deserialise a json representation of array into a std::vector. The json library which i am using is part of Facebook's folly library. I would like to achieve somethings like the following, but unfortunately it's not…
auxdx
  • 2,313
  • 3
  • 21
  • 25
0
votes
0 answers

Compiling problem possible due to wrong header being imported

I have a doubt on how Xcode configures the build process (this is a custom react-native problem). My main file looks like this: #import @interface PodsDummy_Pods_Project : NSObject @end @implementation…
0
votes
0 answers

How to tell if current thread is a folly::executor thread?

I'm writing c++ code that uses folly::executor and I want to check whether the current thread is an executor thread. For example, something like an API static folly::Executor* folly::executor::getExecutor(), which returns a nullptr if current thread…
igbgotiz
  • 892
  • 1
  • 8
  • 28
0
votes
0 answers

build facebook folly library error in WSL2

I am building facebook folly lib in WSL2 Ubuntu system. But it failed. My environment. $ uname -r 5.15.90.1-microsoft-standard-WSL2 $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.5 LTS Release: …
0
votes
0 answers

Use case of folly Indestructible

I came across this feature from folly https://github.com/facebook/folly/blob/main/folly/Indestructible.h#L51 * This is designed as an alternative, but with one fewer allocation at * construction time and one fewer pointer dereference at access…
Zack
  • 1,205
  • 2
  • 14
  • 38
0
votes
0 answers

Folly compiler error making build fail. Is there a workaround?

Error message: Building Solution: C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\XamlCompiler\Microsoft.Windows.UI.X... × Build failed with message…
0
votes
0 answers

How to fix module map file '/***/Pods/Headers/Public/folly/RCT-Folly.modulemap' not found

I have upgraded my RN version from 69.4 -> 70.5 after that change my ios builds are failed with this error: fatal error: module map file '/Users/omerkocer/Akıllı_Karavan/ios/Pods/Headers/Public/folly/RCT-Folly.modulemap' not found in terminal error…
omkocer
  • 153
  • 1
  • 9
0
votes
1 answer

standalone version of folly::Synchronized

Is there a functional equivalent of https://github.com/facebook/folly/blob/main/folly/docs/Synchronized.md that is self-contained and preferably header only so I don't have to pull in entire folly library into my project?
Ghostrider
  • 7,545
  • 7
  • 30
  • 44
0
votes
0 answers

Is thread pool with 1 thread concurrent C++ Folly Executor

I'm having to use an API that uses Facebook Folly Executor library. Tasks (functions) are pushed into a queue, then threads in the thread pool run whatever available task. But in case the pool only has 1 single thread, what happens? For example this…
Huy Le
  • 1,439
  • 4
  • 19