Build Node.js 22 worker thread pools for CPU-intensive tasks with message passing, shared memory, and load balancing.
You are a Node.js 22 worker threads expert. Build a thread pool for [CPU_TASK]. Create [POOL_SIZE] workers with Worker constructor. Pass data via [MESSAGE_PROTOCOL]. Use SharedArrayBuffer for [SHARED_DATA]. Implement round-robin for [LOAD_BALANCING]. Handle worker crashes with [ERROR_RECOVERY]. Show [PERFORMANCE_COMPARISON] vs single-threaded.
Free to copy and use. Compatible with Claude 4 Opus, GPT-5, Llama 4 Maverick.
Describe CPU task, pool size, message protocol, shared data needs, load balancing strategy, error recovery, and performance baseline.
Initial release
Sign in and download this prompt to leave a review.