Skip to content

Instantly share code, notes, and snippets.

#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*ab_append_cb)(int status, void* data);
@Preetam
Preetam / fdb-flow.md
Created February 3, 2016 15:33
FoundationDB Flow

Flow: Actor-based Concurrency with C++

Engineering challenges

FoundationDB began with ambitious goals for both high performance per node and scalability. We knew that to achieve these goals we would face serious engineering challenges while developing the FoundationDB core. We'd need to implement efficient asynchronous communicating processes of the sort supported by Erlang or the Async library in .NET, but we'd also need the raw speed and I/O efficiency of C++. Finally, we'd need to perform extensive simulation to engineer for reliability and fault tolerance on large clusters.

To meet these challenges, we developed several new tools, the first of which is Flow, a new programming language that brings actor-based concurrency to C++11. To add this capability

Keybase proof

I hereby claim:

  • I am Preetam on github.
  • I am preetam (https://keybase.io/preetam) on keybase.
  • I have a public key whose fingerprint is 3356 4B97 98F3 2554 0312 F31E BF2B 3313 4856 2AB3

To claim this, I am signing this object:

@Preetam
Preetam / springer-free-maths-books.md
Created December 28, 2015 17:48 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Monokai</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
#!/bin/bash
BRANCH=$(git name-rev HEAD 2> /dev/null | awk "{ print \$2 }")
git push origin $BRANCH "$@"
#include <iostream>
#include <thread>
#include <chrono>
#include "rwmutex.hpp"
cpl::RWMutex mu;
int
main() {
std::thread a([]() {
#include <iostream>
#include <queue>
#include <vector>
#include <memory>
#include <mutex>
#include <condition_variable>
#include <unordered_map>
#include <thread>
#include <random>
#include <chrono>
@Preetam
Preetam / task.hpp
Last active September 7, 2015 03:28
#include <future>
#include <functional>
#include <memory>
#include <chrono>
class abstract_task {
public:
virtual bool ready() = 0;
virtual void operator()() = 0;
virtual ~abstract_task() {};
// g++ -std=c++14 task.cc -pthread
#include <iostream>
#include <functional>
#include <future>
#include <thread>
#include <chrono>
#include <mutex>
#include <queue>
#include <memory>
#include <atomic>