-
Notifications
You must be signed in to change notification settings - Fork 0
Development
NAMAN JAIN edited this page Aug 3, 2026
·
1 revision
This page outlines the local development setup, coding standards, and common tasks for contributors working on the zThread codebase.
-
OS: A Linux environment (natively or via WSL2) is required because the library depends on kernel-specific features (
epoll,eventfd). - Java: JDK 25.
-
Maven: Included via the Maven Wrapper (
./mvnw).
The project enforces strict code quality and formatting rules. Before submitting a pull request, ensure your code passes the quality profile.
Run the quality check profile:
./mvnw clean verify -PqualityThis runs the following plugins:
- Spotless: Enforces Google Java Format and prepends the Apache 2.0 license header.
- Checkstyle: Validates naming conventions, import ordering, and Javadoc presence.
- PMD: Scans for potential bugs, dead code, and suboptimal performance patterns.
- SpotBugs: Analyzes bytecode for common bug patterns.
If Spotless fails due to formatting, you can automatically fix it with:
./mvnw spotless:apply-
Build and test:
./mvnw clean verify --enable-native-access=ALL-UNNAMED
-
Run benchmarks:
cd zthread-benchmark ../mvnw clean package java --enable-native-access=ALL-UNNAMED -jar target/benchmarks.jar
Because zThread utilizes the FFM API, segmentation faults can occur if off-heap memory is mismanaged or accessed after it has been freed.
To debug native memory issues, you can run the JVM with:
java -XX:NativeMemoryTracking=detail --enable-native-access=ALL-UNNAMED ...For deep native stack traces, attach gdb to the Java process.