Skip to content

Instantly share code, notes, and snippets.

Jeehoon Kang jeehoonkang

Block or report user

Report or block jeehoonkang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:6dcb7b88d1817ce9d5788801f9e8c05a
#include <atomic>
class SpinLock {
std::atomic_flag locked = ATOMIC_FLAG_INIT ;
public:
void lock() {
while (locked.test_and_set(std::memory_order_acquire)) { ; }
}
void unlock() {
locked.clear(std::memory_order_release);
View Linux Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz (12 cores, 24 hw threads)
$ cargo run --release --bin crossbeam-channel | tee crossbeam-channel.txt
Compiling crossbeam-channel v0.1.2 (file:///home/jeehoon.kang/Works/crossbeam-channel)
Compiling benchmark v0.1.0 (file:///home/jeehoon.kang/Works/crossbeam-channel/benchmarks)
Finished release [optimized] target(s) in 7.27 secs
Running `target/release/crossbeam-channel`
bounded0_mpmc Rust channel 6.226 sec
bounded0_mpsc Rust channel 7.147 sec
bounded0_select_both Rust channel 102.518 sec
bounded0_select_rx Rust channel 8.880 sec
bounded0_spmc Rust channel 7.332 sec
@jeehoonkang
jeehoonkang / Dockerfile
Last active Feb 28, 2018
Artifact Evaluation README for PLDI 2018 Submission #41
View Dockerfile
FROM ubuntu:16.04
MAINTAINER Jeehoon Kang <jeehoon.kang@sf.snu.ac.kr>
RUN apt update && apt install -y \
git vim \
gcc libboost-all-dev cmake \
opam m4 pkg-config \
&& rm -rf /var/lib/apt/lists/*
RUN opam init -y && opam switch 4.05.0
@jeehoonkang
jeehoonkang / queue.rs
Created Sep 18, 2017
Intrusive Concurrent MPSC Queue
View queue.rs
/* Copyright (c) 2010-2011 Dmitry Vyukov. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
@jeehoonkang
jeehoonkang / reception-sop.md
Last active Jun 23, 2017
SOP for Wedding Reception
View reception-sop.md

결혼식 접수 SOP

  • 목적: 결혼식 접수를 원활하게 진행하기 위해. 전례를 보아 미리 접수 방법을 숙지하지 않으면 밀려드는 인파를 감당하기 어려울 수도 있음.
  • 작성자: @jeehoonkang (windmorning@gmail.com)

모둠 구성

각 모둠은 한 가문의 손님을 담당한다.

  • 신랑 모둠: 노형균, 박태홍
View add_highlights.py
#!/usr/bin/env python3
import argparse
def interpret_lines(lines):
result = []
for line in lines:
for item in line.split(','):
values = item.split('-')
View gist:49b87436fdb62f1b2b9054a5854ab8bf
cpu1: starting
cpu0: starting
sb: size 1000 nblocks 941 ninodes 200 nlog 30 logstart 2 inodestart 32 bmap start 58
init: starting sh
$ ls
. 1 1 512
.. 1 1 512
README 2 2 2487
cat 2 3 14136
echo 2 4 13368
View xv6-public.diff
diff --git a/Makefile b/Makefile
index 93d525a..db07442 100644
--- a/Makefile
+++ b/Makefile
@@ -70,15 +70,16 @@ QEMU = $(shell if which qemu > /dev/null; \
echo "***" 1>&2; exit 1)
endif
-CC = $(TOOLPREFIX)gcc
+CC = $(TOOLPREFIX)clang
View table.tex
\begin{tabular}{|l||r||r|r|r||r|r|r|}
\hline
& \multicolumn{1}{c||}{\textbf{CompCert}} & \multicolumn{3}{c||}{\textbf{\sepcomp-LevelA}} & \multicolumn{3}{c|}{\textbf{\sepcomp-LevelB}} \\
\cline{3-8}
& \multicolumn{1}{c||}{\textbf{(LOC)}} & \multicolumn{1}{c|}{\textbf{Rm}} & \multicolumn{1}{c|}{\textbf{AddD}} & \multicolumn{1}{c||}{\textbf{AddN}} & \multicolumn{1}{c|}{\textbf{Rm}} & \multicolumn{1}{c|}{\textbf{AddD}} & \multicolumn{1}{c|}{\textbf{AddN}} \\
\hline
\textbf{Total} & 206702 & 318\phantom{0}(0.2\%) & 465 \phantom{0}(0.2\%) & 3392 \phantom{0}(1.6\%) & 372 \phantom{0}(0.2\%) & 1439 \phantom{0}(0.7\%) & 4845 \phantom{0}(2.3\%) \\
\hline
\hline
\textbf{Compiler \& Verification} & 88451 & 318\phantom{0}(0.4\%) & 465 \phantom{0}(0.5\%) & 1153 \phantom{0}(1.3\%) & 372 \phantom{0}(0.4\%) & 1439 \phantom{0}(1.6\%) & 1726 \phantom{0}(2.0\%) \\
View jmm05.md

I think JMM-05 (https://github.com/jeehoonkang/memory-model-explorer/blob/master/test/jmm-05.test) should be allowed, as contrary to the decision JMM people (and we) made. Here is a series of "standard" optimizations that lead JMM-05 into a program that can clearly output the designated outcome.

Series of Optimizations

  • By some global analysis, deduce that r2 should be 0 or 1. Thus transform thread 2 into:

    r2 = y;
    if (r2) {
      x = 1
    } else {
    
You can’t perform that action at this time.