`folly::IOBuf` and zero-copy networking

I see folly::IOBuf often used as a return value (sub-)type in RPC definitions for data intensive and high performance applications. I looked at the code, and it says Well if it's used primarily for networking code, why do applications use it? I don't think people use sk_buff…

Fiber-compatible Future

folly [https://github.com/facebook/folly]'s Future API is Fiber-compatible. > Calling get() on a folly::Future object will only suspend the calling fiber-task. It won't block the system thread, letting it process other tasks. – https://github.com/facebook/folly/blob/master/folly/fibers/README.md But how does it…

Build `folly::coro` with GCC

You have heard about Coroutine in C++, and you want to use it. There're two coroutine implementations that are considered most mature - cppcoro and folly::coro. They are written by the same guy - Lewis Baker. He's brilliant, and you shoud watch his cppcon talk on structured concurrency [https:…

Compile `folly` from source on Arch Linux

You first need to install all the dependencies as documented on the folly [https://github.com/facebook/folly] github page, * fmt * googletest, * boost * gflag * glog These are pretty straightforward, as you can build them just fine by following the github page for each project respectively. However I ran into some…

Linear scalable read-write lock

The basic concept of a read-write lock is simple. It allows multiple readers to access the resource simultaneously, but at most one thread can have exclusive ownership of the lock (a.k.a write lock). It's supposed to be an optimization, comparing to simple mutex (e.g. std::mutex). As…