Netty 4.2 delivers a major architectural rewrite after 10 years: event loops decoupled from transports via IoHandlerFactory, io_uring graduates from incubator with kernel-level batching, the default memory allocator switches to adaptive magazine-style caching, and TLS hostname verification becomes strict by default — all requiring careful migration due to API breakages and classpath incompatibility.
TencentOS Server 4 team debugs a boot hang caused by a systemd sd-event loop defect where pending tasks were ignored, leading to infinite epoll_wait; they traced it to a ratelimit expiry callback introduced in v250, built a reproducible PoC, and upstreamed a fix using an explicit state flag.
This article explains JavaScript's single-threaded event loop model, detailing microtask and macrotask queues, Promise chaining, async/await mechanics, common pitfalls, and practical concurrency control patterns with code examples. It covers classic output prediction exercises, Promise.all/race/allSettled/any usage, async/await error handling, loop await traps, and a reusable limited-concurrency pool implementation for batch requests.
This article introduces Whim, a new Rust-built language that adds reified generics, advanced pattern matching, and a native event-loop async model to PHP, demonstrating via an e-commerce BFF showcase how these features combine to cut microservice aggregation latency from 2.7s to 1.2s.
This article dissects 10 common misconceptions about JavaScript's await keyword, explaining how it evaluates expressions, waits only for Promise settlement — not side effects — and why patterns like forEach with async callbacks, bare setTimeout, and Promise.all can cause silent bugs in production.
Redis sustains millions of concurrent operations not merely because it is single‑threaded, but thanks to its non‑blocking event‑loop I/O, compact in‑memory data structures, serialized command execution that eliminates lock contention, and robust production features such as replication, sharding, persistence, observability and governance.
This article demonstrates a concise method to empower Webman command modules with event‑loop capabilities by extending the Worker class, creating an AbstractCommand base, and defining a concrete command that runs within the event‑loop, complete with runnable code examples and execution output.
The article explains JavaScript’s single‑threaded event loop, classifies macro‑ and micro‑tasks, details their execution order, and walks through classic and advanced code snippets to show how interview questions about output are solved in typical front‑end interview scenarios.
This article explains how Redis achieves lightning‑fast performance with a single‑threaded architecture by leveraging in‑memory operations, IO multiplexing, and event‑driven design, and it details the four key advantages of this approach as well as the evolution introduced in Redis 6.0.
This article explains why synchronous Python code blocks on I/O, introduces asyncio’s event loop and coroutine model, and walks through creating and managing tasks, using TaskGroup, handling timeouts, avoiding common pitfalls, and applying best‑practice patterns for high‑performance I/O‑bound programs.
This article dissects Python's asyncio event loop and coroutine scheduling, compares synchronous threading with asynchronous execution through benchmark tests, examines memory usage across models, presents a full async web service implementation with database and cache pools, and offers a decision matrix for choosing the right concurrency model.
This article compares Node.js and Python for backend development in 2026, examining their architectures, performance benchmarks, ecosystem strengths, and suitable use-cases, and provides a decision framework to help developers choose the most appropriate technology based on project requirements, team skills, and scalability needs.
This article walks through serial file reading, thread‑based parallelism, event‑driven asynchronous I/O, callbacks, and finally shows how coroutines combined with an event loop provide a synchronous‑style solution that scales efficiently without the drawbacks of massive threading.
Discover why a sluggish API hurts user retention, SEO, and costs, and learn eight practical Node.js backend optimization techniques—including mastering the event loop, avoiding blocking code, leveraging async/await, offloading heavy tasks, efficient JSON handling, caching strategies, database tuning, clustering, and continuous monitoring—to boost performance and scalability.
This article explains the three‑stage execution flow of a Redis command—connection establishment, command processing, and result return—detailing how the single‑threaded reactor pattern drives event handling, how commands are parsed and dispatched, and how the output is sent back, with code snippets and a comparison to Netty’s multithreaded reactor.
This article explains Netty's internal mechanisms for buffering outbound data, flushing it to the network, handling inbound responses with NIO selectors, outlines the overall Netty workflow, and clarifies the roles of Backlog and KeepAlive parameters in TCP connections.
Using setTimeout(fn, 0) tricks the JavaScript event loop to downgrade heavy tasks to asynchronous callbacks, freeing the main thread for UI rendering and user interactions, and the article explains the underlying mechanics, practical examples, and modern alternatives like requestAnimationFrame, queueMicrotask, and Web Workers.
This step‑by‑step guide shows how to build a login page featuring a "Send Verification Code" button that counts down using a dynamic panel, event loop, and global variables, covering panel setup, state cycling, conditional logic, and styling for disabled states.
This article explains the underlying browser mechanisms that cause page jank when creating millions of DOM elements, analyzes the event loop, rendering pipeline, macro‑ and micro‑tasks, and presents practical solutions such as setTimeout, requestAnimationFrame, MessageChannel, and requestIdleCallback to keep the UI responsive.
This guide introduces asynchronous Python, explaining why async improves speed, how coroutines and the event loop work, and provides practical examples and common pitfalls to help developers write faster, more efficient I/O‑bound code.
Redis stores data directly in memory rather than on disk, leveraging microsecond‑level access, a single‑threaded Reactor event loop with I/O multiplexing, optimized data structures like strings, hashes, lists, sets, and a simple text protocol, all of which combine to deliver exceptionally high performance for high‑frequency read/write workloads.
The article explains workerman v5’s major updates—including a revolt/event-loop based engine and multi‑implementation coroutine support—while detailing PHP coroutine concepts, practical async export examples, code snippets, and the future challenges of expanding coroutine ecosystems in PHP.
This article explains how Python's asyncio library schedules callbacks with call_soon, call_at, call_later, and call_soon_threadsafe, providing detailed usage descriptions and multiple example code snippets that demonstrate immediate, absolute‑time, relative‑time, and thread‑safe task scheduling within an event loop.
This article explains PHP 8.1 Fibers, describing their cooperative multitasking mechanism, how suspension and resumption affect the main script, why they do not provide true asynchronous execution, and how they can be combined with event loops for more efficient non‑blocking code in backend development.
This article explains how Redis achieves tens of thousands of QPS on average hardware, breaks down the technical reasons behind its speed—including C implementation, in‑memory design, epoll‑based I/O multiplexing, and a single‑threaded event loop—while also detailing the evolution to multithreaded I/O in later versions.
This article explains when React's useEffect callbacks run—whether synchronously before rendering or asynchronously after rendering—by analyzing four demos, discussing the impact of event types, rendering workload, and React's internal scheduling rules.
This article explains asynchronous programming concepts for PHP, introduces the lightweight AMPHP library and its coroutine‑based event loop, outlines core technologies, common use cases, installation steps, required PHP version, and provides practical code examples for building non‑blocking, high‑throughput applications.
The guide explains the browser’s event‑loop cycle, how macro‑tasks, micro‑tasks, requestAnimationFrame and requestIdleCallback interact with rendering, details long‑task impacts, React’s time‑slicing via MessageChannel, key interaction metrics such as TTI, FID and upcoming INP, and practical optimizations like task splitting, lazy loading and service‑worker caching.
This article introduces JavaScript’s origins, core characteristics, and versatile roles—from front‑end scripting in browsers to server‑side execution with Node.js—while explaining its event‑driven model, variable declarations, DOM interaction, and asynchronous programming features for beginners.
This article explains how asynchronous programming and event‑driven mechanisms work in both frontend JavaScript and backend Golang, covering the JavaScript event loop, macro‑ and micro‑tasks, goroutine‑based concurrency, and the kernel‑level epoll architecture that together enable efficient, non‑blocking execution.
This article explains how Redis uses Linux epoll and a single‑threaded event loop to handle millions of connections efficiently, covering the creation of the epoll object, server initialization, event registration, the main processing loop, and the mechanisms for reading, writing, and managing pending tasks.
This article explains JavaScript’s single‑threaded nature, the event loop mechanism, and the distinction between microtasks and macrotasks, illustrating their execution order with detailed code examples and step‑by‑step analysis to help developers grasp asynchronous behavior in front‑end development.
This article explains how asynchronous programming and event‑driven mechanisms work in both frontend JavaScript environments and backend systems such as Go and Linux epoll, covering concepts like the event loop, macro‑ and micro‑tasks, goroutines, channels, and kernel interrupt handling.
This comprehensive guide explains browser fundamentals, covering process and thread architecture, single‑ and multi‑process models, the V8 engine's data types, property ordering, memory allocation and garbage collection, compilation stages, the event loop, rendering pipeline, performance optimization techniques, and security mechanisms.
This article provides a detailed walkthrough of Redis's internal architecture, covering the client module, event‑driven networking, command processing, memory management, persistence strategies, high‑availability features, and the low‑level data structures such as redisServer, redisDb, dict, dictEntry, and redisObject that power its fast key‑value storage.
This article explains Dart’s single‑threaded event‑loop model, the distinction between microtask and event queues, how to schedule tasks, use Futures, async/await, isolates, and practical patterns like LoadBalancer and CancelableOperation to manage asynchronous operations in Flutter apps.
This article explains how async functions, await expressions, and Promise objects interact with JavaScript's event loop, illustrating the differences in micro‑task scheduling through numerous code examples and detailing how return values affect the number of queued tasks.
Node.js is a server‑side JavaScript runtime built on V8 that replaces the browser environment with native libraries, uses libuv’s event loop and thread pool to provide non‑blocking asynchronous I/O, and organizes its architecture into application code, V8, bindings, and libuv layers for efficient backend development.
This article explains why JavaScript, despite being single‑threaded, needs asynchronous mechanisms such as the event loop, details macro‑ and micro‑tasks, compares browser and Node.js implementations, and demonstrates common pitfalls and best practices using callbacks, Promise, generator, and async/await patterns.
This article explains the fundamentals of JavaScript's event loop, covering browser asynchronous execution, macro‑ and micro‑tasks, timer inaccuracies, view rendering, and the differences in Node.js implementation, while providing code examples to illustrate execution order and practical implications for developers.
This article explains the fundamentals of JavaScript's event loop, covering single‑threaded execution, the role of macro‑tasks and micro‑tasks, differences between browser and Node.js implementations, and includes code examples that illustrate task scheduling and execution order.
This comprehensive guide explores Node.js’s architecture, core APIs, global variables, built‑in modules, function styles, the event‑loop mechanics, task scheduling, next‑tick and microtasks, libuv’s role, and strategies for off‑loading work, providing developers with a deep understanding of how Node.js runs JavaScript efficiently.
Asynchronous ProgrammingNode.jsbackend development
This article explains Redis's single‑threaded architecture, its limitations, and how Redis 6.0+ adds configurable I/O threads to parallelize read/write handling, detailing the server initialization, event loop, task queues, and the interaction between the main thread and worker threads.
This article introduces Python's asyncio library, explains the fundamentals of coroutines, tasks, and the event loop, compares synchronous and asynchronous code execution with practical examples, and demonstrates how asynchronous programming can significantly improve performance in I/O‑bound scenarios.
This article provides an in‑depth technical overview of iOS RunLoop, explaining its relationship to threads, event loops, RunLoop modes, sources, timers, observers, and the underlying Mach message mechanisms, while including original source code excerpts for reference.
This article explains how Redis uses Linux epoll and a single‑threaded event‑driven architecture to handle tens of thousands of connections efficiently, detailing the initialization of the server, the event‑loop mechanics, and the processing of client commands from accept to reply.
This article explains why simple serial file reads are slow, compares multithreaded and event‑loop based approaches, introduces the Reactor pattern and callbacks, and finally shows how coroutines provide a synchronous‑style solution for efficient, non‑blocking I/O processing.
This article provides a comprehensive source-level analysis of Redis 6.0 and later multi-threaded architecture, detailing how the main event loop coordinates with dedicated I/O threads to efficiently distribute, parse, and process concurrent read and write requests while maintaining high throughput and low latency.
This article explains how JavaScript's single‑threaded engine uses the event loop to manage synchronous and asynchronous tasks, distinguishes macro‑tasks from micro‑tasks, and compares the implementations in browsers and Node.js, including version‑specific behavior and common pitfalls.
This article explains how Redis initializes, creates a TCP listener, registers file events, runs a single‑threaded reactor loop, accepts client connections, processes commands via a command table, and sends replies, illustrating the core backend architecture of the in‑memory database.
This article walks through Redis’s annotated source code to explain how its single‑threaded architecture initializes the server, loads configuration and data, and continuously processes file and time events within a while‑loop, revealing why Redis achieves high performance without spawning additional worker threads.
This article examines Redis's single‑threaded architecture by walking through its source code, detailing the main function initialization steps, the event‑loop implementation, and how file and time events are processed, while also noting the promotional messages interspersed throughout.
The article explains how the V8 engine parses source code into an AST, compiles it to bytecode and optimized machine code, describes JavaScript execution concepts such as scopes, call stacks, and the event loop, and provides practical performance‑tuning tips with code examples.
The article explains how Redis, originally a single‑threaded in‑memory cache, introduces Lazy Free in version 4.0 and multi‑threaded I/O in version 6.0 to mitigate blocking during large key deletions, describes the underlying event‑driven architecture, shows relevant source code, and discusses the benefits and constraints of these mechanisms.
requestAnimationFrame lets browsers schedule animation callbacks just before the next repaint, offering smoother 60 Hz updates compared to setTimeout; this article explains its API, demonstrates code examples, explores the event loop, task and microtask queues, rendering timing, cross‑browser quirks, and best practices for efficient animation and task splitting.
This article compares the evolution of coroutines in Python and JavaScript, explaining their shared goals, core concepts, historical milestones, mature implementations, and practical code examples to help newcomers understand asynchronous programming across both languages.
This article provides a comprehensive overview of Node.js’s architecture, including its composition, code structure, startup process, event loop phases, process and thread management, core modules such as Cluster, libuv thread pool, signal handling, file operations, and networking protocols, illustrating how the runtime integrates V8 and operating‑system features.
This article compares the evolution, concepts, and practical implementations of coroutines in Python and JavaScript, explaining their histories, core mechanisms such as async/await, event loops, and providing side‑by‑side code examples to help newcomers understand asynchronous programming in both languages.
This article explains Python's asyncio asynchronous I/O model, how to define and run coroutines, use callbacks, manage multiple concurrent tasks with gather, compare run_until_complete with run_forever, and properly close the event loop, providing clear code examples throughout.
Although JavaScript runs on a single thread, it can handle asynchronous operations through mechanisms like setTimeout, and React 18’s startTransition lets developers separate urgent UI updates from deferred work, improving responsiveness by scheduling non‑urgent tasks after urgent ones complete.
This article explains JavaScript's single‑threaded nature, the various browser threads, how the event loop coordinates synchronous and asynchronous tasks, the roles of macro‑ and micro‑task queues, and how the execution stack processes them to achieve non‑blocking behavior.
The article examines why libuv handles file operations with a thread pool rather than true asynchronous disk I/O, outlining the engineering challenges of async disk APIs, the advantages of a blocking‑call thread pool, and details of libuv’s thread‑pool configuration and performance implications.
This article explores the historical reasons behind JavaScript's event loop, explains the task and microtask queues, compares browser and Node.js implementations, and provides concrete code examples to illustrate how tasks are scheduled and executed across environments.
libuv is a cross‑platform asynchronous I/O library originally built for Node.js that abstracts event‑driven I/O via handles and requests, provides a single‑threaded event loop with platform‑specific poll mechanisms, and uses a global thread pool for file and DNS operations, all while maintaining a consistent execution model.
This article walks through Redis's startup sequence, explaining how the server creates a listening socket, registers events with the aeFileEvent system, runs a single‑threaded select‑based event loop, and processes client commands using the Reactor pattern, complete with code examples and diagrams.
Vue.nextTick schedules callbacks using a graceful‑degradation chain (Promise, MutationObserver, setImmediate, setTimeout) that leverages the JavaScript event‑loop’s micro‑task queue, ensuring DOM mutations are applied instantly but rendered after microtasks and before macrotasks, while the browser’s multi‑threaded architecture coordinates rendering, timers, and network work.
This article explains Redis's clean and elegant I/O multiplexing implementation, covering blocking I/O limitations, the reactor pattern, abstraction of select/epoll/kqueue into a unified API, key source functions, and platform‑specific module selection to achieve high‑performance single‑threaded networking.
This article explains Nginx’s high performance by dissecting its multi‑process architecture, master‑worker model, event‑driven handling using epoll, request lifecycle, module types, comparison with Apache, and I/O models such as select, poll, and epoll, plus configuration limits for maximum connections.
This article explains JavaScript's single‑threaded nature, the task queue, macro‑ and micro‑tasks, the event loop, and compares callbacks, Promises, Generators, and async/await with code examples and practical pros and cons for front‑end developers.
This article provides a deep technical walkthrough of libuv’s Linux implementation, covering epoll‑based I/O handling, level‑ and edge‑triggered events, the event‑loop architecture, timer management with a min‑heap, thread‑pool integration, and the mechanisms that drive asynchronous callbacks in Node.js.
This article explains what synchronous and asynchronous Python code mean, how they are implemented in web servers, the performance factors of context switching and scalability, and the specific scenarios where async can outperform sync.
This article explains how Redis evolves from a single‑threaded event‑driven cache to using Lazy Free for asynchronous key deletion and multi‑threaded I/O for improved performance, detailing the underlying mechanisms, code implementations, limitations, and comparisons with Tair's threading model.
This article explains how Python’s coroutine model evolved from Tornado’s single‑threaded async/await support to a generator‑based micro‑framework that uses IO multiplexing, callbacks, futures and stack‑based call‑chain handling to achieve non‑blocking network programming.
The article traces Redis’s shift from its original single‑threaded reactor model to the I/O‑threaded architecture introduced in version 6, explaining how atomic operations and round‑robin client distribution let separate threads handle network I/O and parsing while the main thread executes commands, yielding roughly a two‑fold throughput boost but retaining a single‑threaded command core and incurring brief CPU spikes from busy‑wait synchronization.
This article explains how servers handle massive concurrent requests by evolving from simple multi‑process models to lightweight threads, then to event‑driven architectures with I/O multiplexing, highlighting the trade‑offs of blocking versus non‑blocking I/O and the role of coroutines.
This article provides a concise, code‑driven walkthrough of Netty's core components—including event‑loop groups, channel initialization, pipeline handling, and the server‑client handshake process—by simplifying the original source to highlight the essential mechanisms behind asynchronous network communication in Java.
This article explains Redis's event-driven architecture, detailing file and time events, their processing flow, and why Redis 6.0 introduced multithreading to improve network I/O while keeping command execution single‑threaded.
The article explains JavaScript’s single‑threaded execution stack and how the event loop—using an event queue, micro‑tasks, and macro‑tasks—coordinates asynchronous operations in browsers and Node.js, detailing libuv’s stages and showing how this model enables non‑blocking, concurrent programming.
CHRE (Context Hub Runtime Environment) is an event‑driven, single‑threaded framework that hosts nanoapps on a sensor hub, organizing its source tree into API, Core, PAL, Platform, Apps, and Util directories, and managing events through a singleton EventLoopManager that initializes, queues, and dispatches system and nanoapp events.
The article explains that JavaScript’s single‑threaded language model relies on the engine and runtime to provide asynchronous I/O and an event loop for concurrency, while multi‑core utilization is achieved through workers, child processes, or clusters, and synchronous APIs remain useful for short, predictable tasks.
This article explains why Redis, a single‑threaded server, adopts I/O multiplexing to avoid blocking, compares blocking I/O with multiplexed models, and details the internal implementation of select, epoll, and kqueue wrappers that power Redis's high‑performance event loop.
This article explains Vue's $nextTick by first detailing JavaScript's single‑threaded event loop, then showing how Vue batches DOM updates using macro‑ and micro‑tasks, and finally walks through a custom implementation with code examples and common pitfalls.
The article examines JavaScript’s event loop by contrasting macro‑tasks and micro‑tasks, tracing their spec‑defined origins, showing how callbacks, timers, Promises, async/await and generators are queued, and highlighting differences between browsers and Node.js (pre‑v11 vs v11+) that affect execution timing.
This article explains Redis server's event-driven architecture, detailing how file events (read/write) and time events are processed, illustrated with state diagrams, pseudocode, and examples that show the interaction, scheduling, and impact on server performance.
The article explains JavaScript’s single‑threaded nature and how asynchronous programming—using callbacks, timers, Ajax, and Promises—relies on the event loop to manage macro‑tasks and micro‑tasks, illustrates execution order, warns against callback hell, and provides a custom Promise implementation.
This article explains the iOS RunLoop mechanism, its role in keeping apps responsive, how it interacts with UIApplicationMain, timers, thread management, and various RunLoop modes, and provides practical examples for using RunLoop to maintain thread life cycles and improve UI performance.
This article explains the step‑by‑step process Redis follows to launch, from executing the redis‑server binary, initializing the server struct, loading configuration files, setting up data structures, restoring persistence, to entering the event loop.
This article explains Node.js's internal concurrency model, covering the distinction between processes and threads, debunking the single‑thread myth, and detailing how the event loop, child processes, cluster mode, and worker_threads enable high‑performance, multi‑core execution.
This article explains Redis's startup sequence, detailing server initialization, configuration loading, event‑loop creation, supported I/O multiplexing mechanisms, timer and I/O callbacks, and the complete request‑response flow from client command to server reply.
The article explains JavaScript's single‑threaded, event‑loop based asynchronous model, demonstrates how setTimeout’s imprecise timing can cause unexpected behavior in a jQuery Ajax timeout scenario, and offers practical guidance to avoid relying on exact timer scheduling.
This article explains the evolution of Google V8's Promise implementation, details the JavaScript single‑threaded event loop with macro‑ and micro‑tasks, describes various programming models, and walks through the internal V8 code that realizes Promise construction, chaining, and utility methods such as Promise.all and Promise.race.
This article explains how Python's asyncio library enables asynchronous programming by defining coroutine functions with async/await, managing execution with an event loop, coordinating multiple tasks using gather, wait, and ensure_future, and integrating synchronous code via executors for concurrent execution.
This article explains JavaScript’s event mechanism, distinguishes macro‑ and micro‑tasks, and provides a comprehensive guide to using Promises—including their states, API methods like then, catch, finally, and utilities such as all, race, with practical code examples and common pitfalls.
Discover how a playful setTimeout‑based sorting trick leverages JavaScript’s event loop to produce correct ordering, while explaining the core concepts of synchronous vs asynchronous tasks, the execution stack, task queue, and why this method isn’t practical for large datasets.
This article dives deep into Node.js internals, explaining why the runtime is both single‑threaded and multi‑threaded, how the event loop, libuv thread pool, epoll/kqueue, and worker_threads collaborate to deliver non‑blocking I/O and efficient concurrency.
This article provides a comprehensive technical overview of Swoole's coroutine implementation in PHP 7.1, detailing C‑stack and PHP‑stack management, context switching via boost.context, coroutine creation, scheduling, and I/O event handling, supplemented with diagrams and code excerpts.
This article examines Redis's I/O multiplexing mechanism, explaining why it uses non‑blocking models, detailing the Reactor pattern, comparing select, epoll, and kqueue, and providing a thorough walkthrough of the underlying C code that implements event creation, addition, deletion, and polling across platforms.
This article explains Redis’s core architecture by detailing its event‑driven model, the initialization of the event loop, how file and time events are handled, and walks through a complete client command flow such as a SET operation, illustrated with key source‑code excerpts.
This article explains Python's asyncio module, presents a practical HTTP keep-alive benchmark tool built with async I/O, details test setup and performance results, and summarizes key asyncio concepts such as event loops, futures, coroutines, and generators.
This article introduces Python's asyncio library, explains how coroutines are defined and run, demonstrates event‑loop management with run_until_complete and run_forever, covers callbacks, gathering multiple coroutines, and best practices for closing loops, all illustrated with clear code screenshots.