Skip to content

Instantly share code, notes, and snippets.

View ra1u's full-sized avatar
💻
Focusing

Luka Rahne ra1u

💻
Focusing
View GitHub Profile
#include <iostream>
#include <chrono>
#include <thread>
#include <atomic>
using namespace std::literals;
// compile command
// g++ -lpthread -std=c++14 -march=native -O3 timeTest.cpp -o timeTest
@ra1u
ra1u / timeTest.cpp
Created May 25, 2015 17:02
gcc tight loop measure
#include <iostream>
#include <chrono>
#include <thread>
#include <atomic>
using namespace std::literals;
// compile command
// g++ -lpthread -std=c++14 -march=native -O3 timeTest.cpp -o timeTest
@ra1u
ra1u / trans.c
Created May 14, 2015 19:35
transactonal memory dining philosopers
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
typedef struct { int food; } philosoper_type;
static inline int eat(philosoper_type *philo, int *lfork, int *rfork) {
int r = 0;
while (!r) {
import 'dart:io';
int PORT = 5555;
void testconnect(){
print("testconnect");
Socket.connect("localhost", PORT).then((Socket sock){
sock.add("hello".codeUnits);
});
}