Tachyon is a high-performance, cross-language IPC library that provides a lock-free, single-producer single-consumer (SPSC) ring buffer over POSIX shared memory. It achieves sub-100 nanosecond round-trip times by using zero-copy payloads, futex-based blocking, and a handshake protocol that transfers anonymous memory file descriptors via Unix domain sockets. The library exposes a C API and ships idiomatic bindings for Python, Rust, Go, Java, Kotlin, C#, and Node.js/TypeScript, all sharing the same core C++ implementation. It supports both unidirectional publish-subscribe and bidirectional RPC patterns, with batch operations, NUMA binding, and configurable polling modes. The codebase is production-grade: it includes extensive fuzz testing, architecture decision records, seccomp BPF profiles, a monitoring CLI tool, and a mature release pipeline publishing to all major package registries. The design is notable for its minimal syscall footprint on the hot path (only futex), careful cache-line alignment, and a no-serialization contract that lets consumers read payloads directly from shared memory.
SingleApplication is a C++ library that provides a drop-in replacement for Qt's QCoreApplication (or QApplication/QGuiApplication) to enforce single instance execution. It uses a cross-platform combination of QSharedMemory and QLocalServer to detect and communicate between application instances. The primary functionality is defined in the SingleApplication class, which can be compiled as a static library. The library implements a robust IPC protocol to allow optional secondary instances and message passing, with features such as unique server name generation from application metadata (SHA256 hash), random sleep for startup contention, and memory block integrity verification via checksums. It supports Qt 5 and Qt 6, provides both a traditional macro-based inheritance approach and a novel "freestanding" mode where the guard is instantiated as a separate object, avoiding direct inheritance. CI tests cover build and integration on Windows, macOS, and Linux. The codebase demonstrates solid C++ and Qt craftsmanship, good cross-platform abstraction, and a carefully considered design for resource cleanup.
junixsocket is a Java/JNI library providing Unix domain socket (AF_UNIX) support and other advanced socket families (AF_TIPC, AF_VSOCK, AF_SYSTEM) to Java applications. It extends standard Java Socket and NIO APIs with features like ancillary data (file descriptor passing), peer credentials, abstract namespace, SSL/TLS, RMI, and shared memory. The architecture is modular with core modules (junixsocket-common, junixsocket-native) and protocol-specific extensions. Key entry points include factory methods in AFUNIXSocket/AFUNIXServerSocket, SSLContextBuilder, and AFUNIXNaming. Data flows involve JNI-mediated socket operations for IPC, with advanced features using native ancillary messaging. External dependencies include optional integrations (MySQL Connector/J, Jetty, Netty) and platform-specific toolchains for native builds.
This repository implements the Adaptive Query Optimization (AQO) extension for PostgreSQL, a machine learning-based system that improves query planning by learning from historical query execution statistics. The extension integrates with PostgreSQL's planner and executor via hook mechanisms to override cardinality estimation with predictions from per-query-class k-nearest neighbors regression models. It features a multi-layer architecture: preprocessing (query classification and mode handling), cardinality estimation (ML-based prediction), postprocessing (statistics collection and model updates), and shared memory persistence for query statistics and ML models. Key operational modes include disabled, learn, intelligent, controlled, and forced, controlled via GUCs. The system automatically tunes learning/usage flags based on prediction stability and includes background workers for maintenance. The extension requires patching PostgreSQL source and rebuilding, with tight coupling to internal planner structures (e.g., RelOptInfo, Plan nodes) and executor functions. Deployment involves setting shared_preload_libraries, configuring GUCs like AQO.mode, and managing memory limits for query classes and feature subspaces. It provides SQL interfaces for managing query classes (enable/disable, status checks) and EXPLAIN integration for runtime visibility. The test suite includes pgbench integration, SQL scripts for feature validation, and Perl scripts for pg_stat_statements compatibility. While the core AQO logic is highly specialized to PostgreSQL, two components demonstrate extractable excellence: the hash function for query normalization (ignoring constants/whitespace) and the standalone k-NN regression implementation with linear smoothing. These show non-obvious skill in handling SQL variability and efficient online learning. However, the deep integration with PostgreSQL internals, version-specific patching requirements, and complex state management introduce maintenance challenges and technical debt risks, particularly during PostgreSQL version upgrades.