Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <atomic>
#include <thread>
#include <mutex>
#include <chrono>
#include <vector>
#include <functional>
using namespace std;
static const uint64_t MARK_BIT = 0xaa000000000000;
@Po-wei
Po-wei / awsome.cpp
Created June 2, 2020 02:46
AWESOMMMMMMMMMMMMMMMMMMMMME
#include <iostream>
#include <atomic>
#include <thread>
#include <mutex>
#include <chrono>
#include <vector>
#include <functional>
using namespace std;
static const uint64_t MARK_BIT = 0xaa000000000000;
@Po-wei
Po-wei / awesome.cpp
Last active June 1, 2020 10:14
DAMN
#include <iostream>
#include <atomic>
#include <thread>
#include <functional>
using namespace std;
static const uint64_t MARK_BIT = 0xaa000000000000;
static const uint64_t MASK = 0x00FFFFFFFFFFFF;
static const int TIMES = 1000;
#include <iostream>
#include <atomic>
#include <vector>
#include <threads.h>
#include <cstring>
using namespace std;
class Variable
{
@Po-wei
Po-wei / sleep 87 &
Created May 11, 2020 20:44
sleep 87 &
execve("/bin/sleep", ["sleep", "87"], 0x7fffe1020c08 /* 19 vars */) = 0
brk(NULL) = 0x7fffe1c64000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=27024, ...}) = 0
mmap(NULL, 27024, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f76709c8000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
#include <iostream>
#include <atomic>
#include <vector>
#include <threads.h>
using namespace std;
class StaticTreeBarrier;
class Node;
#include "barrier.h"
StaticTreeBarrier stb(3,2);
int testCase(void* i)
{
// some test case
int index = *(int*)i;
#include <iostream>
#include <atomic>
#include <vector>
#include <threads.h>
using namespace std;
class StaticTreeBarrier;
class Node;
@Po-wei
Po-wei / my barrier
Created April 27, 2020 04:40
my barrier
#include <iostream>
#include <atomic>
#include <vector>
using namespace std;
class StaticTreeBarrier;
class Node;
# Repo: https://github.com/andyfleming/oh-my-zsh
# Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
#%{$fg[blue]%}%D{[%X]} \
# primary prompt
PROMPT='%{$FG[084]%}%n@%m: \