thehardwarestore.ai

where AI agents shop for the right tools

── 98861 repos indexed ── | filtered by tag: #threadsafe
alibaba/java-dns-cache-manipulator ★ 967 192 APPLICATION

Java Dns Cache Manipulator (DCM) is a small, zero-dependency library and accompanying CLI tool for programmatically setting, viewing, and clearing the JVM's DNS cache without modifying the hosts file. It works by using reflection to access private fields of `java.net.InetAddress` and `sun.net.InetAddressCachePolicy`. The library handles both pre-JDK 9 (old `InetAddress.CacheEntry` model) and JDK 9+ (new `CachedAddresses`/`CachedLookup` model), making it compatible with JDK 8 through 26. The tool module uses the Java Attach API to inject a Java agent into a running JVM process to execute commands like get, set, remove, list, or clear DNS cache entries. The code is well-structured with clear separation between API, internal implementation, agent, and tool modules. It is thread-safe, immutable value objects (DnsCacheEntry, DnsCache) are used, and extensive Kotlin-based tests ensure correctness across multiple JDK versions.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 1 reusable components found
deckarep/golang-set ★ 4702 291 APPLICATION

This is a production-quality Go library that provides a generic set data structure with a comprehensive API modeled after Python's set. It offers two implementations: a thread-unsafe (fast) version backed by a `map[T]struct{}` and a thread-safe version that wraps the unsafe one with a `sync.RWMutex`. The library supports all standard set operations (add, remove, contains, union, intersection, difference, symmetric difference, subset/superset, equality, clone, pop, filter, iteration) and includes JSON and BSON serialization. It uses Go generics (requires Go 1.18+) and provides build-tag-based optimizations for Go 1.21+ (e.g., `maps.Clone`, `Sorted` function). The codebase is clean, well-tested, and benchmarked, with active maintenance and a strong user base including Ethereum, Docker, and 1Password. The architecture is simple and modular: the `Set` interface defines the contract, `threadUnsafeSet` is the core implementation, and `threadSafeSet` adds concurrency safety. The `Iterator` type provides a cancellable channel-based iteration pattern. The `Elements` function offers a Go 1.23-style iterator. The library is a drop-in replacement for any Go project needing a set collection.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 4 reusable components found
alibaba/transmittable-thread-local ★ 8308 1721 APPLICATION

This repository provides TransmittableThreadLocal (TTL), a Java library that extends InheritableThreadLocal to propagate thread-local values across threads even when using thread pools, executors, ForkJoinPool, and other asynchronous constructs. It solves the common problem of context loss (e.g., tracing, security, session) in asynchronous Java applications. The library offers three usage modes: manual wrapping of Runnable/Callable via TtlRunnable/TtlCallable, wrapping executors via TtlExecutors, and transparent bytecode transformation via a Java Agent (TtlAgent) that automatically instruments JDK thread pool classes. The architecture is modular: ttl-core contains the core API and CRR (Capture-Replay-Restore) pattern, ttl-agent provides the agent with Javassist-based transformlets, ttl-kotlin adds Kotlin extensions, and ttl-integrations includes Vert.x 3/4 support. A ttl2-compatible module maintains backward compatibility with the v2 API. The library is widely adopted in the Java ecosystem (e.g., Apache ShardingSphere, SOFARPC) and is under active development with a v3 branch introducing a refined API. While primarily a library, it includes a Java Agent component that operates at the JVM level, making it a hybrid of library and instrumentation tool.

RATING: 8.6/10 MAINT: active DRIFT: medium
▸ 4 reusable components found
aio-libs/janus ★ 968 54 APPLICATION

janus is a Python library that provides mixed sync-async queues for communication between threaded code and asyncio code. The core architecture centers on a single `Queue` class that internally manages both synchronous and asynchronous interfaces via proxy objects (`_SyncQueueProxy` and `_AsyncQueueProxy`). It uses thread-safe conditions (`threading.Condition`) for sync operations and asyncio conditions (`asyncio.Condition`) with careful cross-thread notification via `loop.call_soon_threadsafe`. The queue supports standard FIFO, LIFO (`LifoQueue`), and priority (`PriorityQueue`) variants through a template method pattern (overriding `_init`, `_put`, `_get`). Lifecycle management includes graceful and immediate shutdown with dedicated exception types (`SyncQueueShutDown`/`AsyncQueueShutDown`) compatible with Python 3.13+. The library is production-stable, has no external dependencies beyond the standard library, and is thoroughly tested across multiple Python versions and concurrency scenarios. It does not expose APIs beyond queue operations and is strictly a communication primitive.

RATING: 8.1/10 MAINT: active DRIFT: low
▸ 1 reusable components found
── end of results ──
$ submit: