Skip to content

Instantly share code, notes, and snippets.


Alkis Evlogimenos alkis

View GitHub Profile
template <class Sync>
void Sequence(benchmark::State& state) {
static Sync sync;
static std::atomic<uint64> pseq{0};
static uint64 cseq{0};
std::priority_queue<int, std::vector<int>, std::greater<int>> queue;
typename Sync::Mem mem;
for (auto _ : state) {
uint64 p = pseq.fetch_add(std::memory_order_relaxed);
sync.Run(&mem, [&, p] {
View callback-chain.h
#include <atomic>
#include <cstring>
#include <utility>
#include "third_party/absl/container/internal/container_memory.h"
#include "third_party/absl/container/internal/layout.h"
alkis /
Last active Apr 19, 2018
The case for deadlines

The case for deadlines

Rust aims to be the foundation of fast and robust software. A thorn in that side is the choice of timeout-centric APIs for I/O and multithreading. I posit this was a bad choice and it needs to be remedied as soon as possible before more APIs proliferate this (possibly accidental) design decision.

Motivating example: time limited network client request

Task: connect to a remote server, send a request, receive response with an end-to-end timeout of 10 seconds.

Attempt #1

alkis /
Last active Oct 20, 2016
c++ library multiversioning
// Copyright 2016 Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
View gist:550422
<html xmlns:ng="">
<script type="text/javascript"
src="" ng:autobind></script>
<script type="text/javascript">
var list = [{timestamp:new Date()}, {timestamp:new Date(1234567890)}, {timestamp:new Date(5678901234)}];
You can’t perform that action at this time.