Skip to content

Instantly share code, notes, and snippets.

View komamitsu's full-sized avatar

Mitsunori Komatsu komamitsu

View GitHub Profile
# Wormhole4j v0.3.0: Adding Multi-threaded Concurrency
## 1. Introduction
- Quick recap of Wormhole4j
- What changed in v0.3.0 (real multi-thread support)
- Why this matters
---
### Blog Post Structure: "Scaling Wormhole4j: Lock-Free Concurrency and Verified Correctness"
#### 1. Introduction: The Evolution
* **The Mission:** Briefly recap the original *Wormhole* paper (EuroSys '19) goal: a fast $O(\log L)$ ordered index.
* **The Problem:** While the original was a performance breakthrough, it was strictly single-threaded. Real-world infrastructure requires concurrency.
* **The Announcement:** Introduce v0.3.0, the culmination of adding multi-threaded support while preserving the core performance advantages.
#### 2. The Architecture of Concurrency
* **The Structural Conflict:** Explain why concurrent ordered indexes are difficult—modifications like splits/merges ripple through both the `LeafList` and the `MetaTrieHT`, creating a bottleneck.
* **The Three-Layer Strategy:** Explain the concurrency model:
# Wormhole4j 0.3: Thread-Safe Concurrent Access
## 1. Introduction
- Recap of Wormhole4j: fast ordered map, O(log L) lookups, EuroSys '19 paper
- The gap: single-threaded only until now
- What this post covers: design, correctness verification, benchmarks
## 2. Why Concurrent Ordered Indexes Are Hard
- Maintaining order + range scans rules out simple approaches
- The specific problem: splits/merges modify both the LeafList
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.fury.Fury;
import org.apache.fury.config.Language;
import org.msgpack.jackson.dataformat.MessagePackMapper;
import java.io.IOException;
import java.util.*;
@komamitsu
komamitsu / how-to-build-and-run-ydb.md
Created June 1, 2024 03:48
How to build and run YugabyteDB on macOS

Download the source code

git clone https://github.com/yugabyte/yugabyte-db.git
cd yugabyte-db

Build YugabyteDB

@komamitsu
komamitsu / millions-hello-worlds.c
Created March 2, 2024 03:35
"Hello, World!" without recursions or loop
#include <stdio.h>
#include <ucontext.h>
#define N 1000000
int main(){
int i = 0;
ucontext_t ctxt;
getcontext(&ctxt);
package org.example;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@komamitsu
komamitsu / systemd-xremap.md
Last active April 28, 2026 23:29
Execute xremap from systemd

Execute xremap as root user

Create /etc/systemd/system/xremap.service file

[Unit]
Description=xremap service
After=default.target

[Service]
package org.komamitsu.unixdomainsockettest;
import java.net.StandardProtocolFamily;
import java.net.UnixDomainSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;