Tagged articles
multiprocessing
75 articles · Page 1 of 1
The article explains processes as independent execution units and threads as lightweight CPU‑scheduled workers, using a boss‑and‑employees metaphor, code samples in Python and Java, practical scenarios, common pitfalls like race conditions and deadlocks, and guidance on when to choose multiprocessing versus multithreading.
ConcurrencyMultithreadingParallelism
0 likes · 9 min read

This article walks through diagnosing a severe GPU under‑utilization bug in an 8‑A100 training job, explains why the default Dataset/DataLoader setup stalls, and presents a step‑by‑step redesign using MapDataset or IterableDataset, WebDataset tar shards, tuned DataLoader parameters, worker‑level seeding, GPU‑side prefetching, and distributed sampling to boost GPU utilization from 5‑12% to over 85% while cutting epoch time from 40 h to 9 h.
DataLoaderDistributedSamplerGPU prefetch
0 likes · 22 min read

This article examines Python's three concurrency models—threading, multiprocessing, and asyncio coroutines—detailing their underlying mechanisms, performance traits, suitable use‑cases, and the impact of the Global Interpreter Lock, followed by a hybrid web‑server implementation example.
ConcurrencyGILPython
0 likes · 9 min read

The "Academic Path" lecture series at Tsinghua University taught non‑CS students practical Python techniques—including Requests, AJAX, Selenium, PDF parsing, and multiprocessing—to extract, process, and analyze financial data, culminating in hands‑on case studies of ESG news, A‑share reports, and IFC databases.
Pythonfinancial datamultiprocessing
0 likes · 4 min read

This article details the design and implementation of an Android ad‑monitoring platform that controls multiple devices concurrently, automates app interactions, uses OCR for ad detection, and provides real‑time status monitoring via a floating window, while covering architecture, core modules, communication strategies, and performance optimizations.
ADBAd MonitoringAndroid
0 likes · 27 min read

This article breaks down Python’s Global Interpreter Lock, explains when to use multiprocessing, multithreading or asyncio, provides concrete performance benchmarks and a hybrid process‑coroutine pattern, and guides you on choosing the right concurrency model for interview questions.
ConcurrencyInterviewMultithreading
0 likes · 57 min read

This comprehensive guide explores Python concurrency and parallelism, covering threading, multiprocessing, async/await, the GIL, thread safety, thread pools, process pools, producer‑consumer patterns, performance testing, and practical best‑practice recommendations for choosing the right concurrency model.
ConcurrencyGILasyncio
0 likes · 25 min read

This article explains the differences between concurrency and parallelism, the impact of Python's Global Interpreter Lock, and provides a detailed comparison of threading, multiprocessing, and asyncio with code examples, performance tests, decision flowcharts, mixed‑usage patterns, common pitfalls, and best‑practice recommendations for choosing the right approach.
GILasynciomultiprocessing
0 likes · 11 min read

This article explains a Python multiprocessing issue raised in a community chat, shows discussion and execution screenshots, presents a solution highlighting that the target argument must be a function name without parentheses, and clarifies the difference between passing a function object versus its return value.
PythonTutorialmultiprocessing
0 likes · 3 min read

This article explains how to decide between asyncio, threading, and multiprocessing for Python programs by examining I/O‑bound versus CPU‑bound workloads, showing real code examples, trade‑offs, and common pitfalls to help you pick the right concurrency tool for your task.
MultithreadingPythonasyncio
0 likes · 9 min read

This article explains how Python’s GIL affects concurrency, when to use multithreading versus multiprocessing, and provides practical tips on efficient inter‑process communication, iteration, string handling, sorting, file I/O, and leveraging the standard library to dramatically improve script performance.
Multithreadingbest-practicesdata structures
0 likes · 17 min read

This article explains the fundamental concepts of processes and threads, their relationship, resource allocation, scheduling, communication methods, practical use cases, and interview preparation tips, helping readers choose between multiprocessing and multithreading for various scenarios.
ConcurrencyMultithreadingThread
0 likes · 22 min read

This article provides an in‑depth overview of Python’s multiprocessing module, covering its fundamentals, process creation, inter‑process communication methods such as Queue, Pipe, shared memory, process pools, synchronization techniques, and practical best‑practice guidelines for effective parallel programming.
IPCProcess PoolPython
0 likes · 10 min read

This article explains the concepts of processes and threads, describes Python's Global Interpreter Lock (GIL) and its impact on concurrency, compares the low‑level _thread module with the higher‑level threading module, and provides example code illustrating thread creation, synchronization with locks, and common pitfalls.
ConcurrencyGILLock
0 likes · 5 min read

This article explains why limiting a function's execution time is crucial for stability, and demonstrates multiple Python techniques—including the func-timeout library, custom multiprocessing, subprocess.run, and signal handling—to set and manage timeouts effectively.
PythonSignalerror handling
0 likes · 8 min read

This article explains Python's multithreading and multiprocessing concepts, compares thread pools and process pools, provides practical code examples for task execution and file downloading, and offers performance tips and best practices for writing efficient concurrent programs.
PythonThreadPoolmultiprocessing
0 likes · 14 min read

This article explains what the Python Global Interpreter Lock (GIL) is, why it was introduced, how it affects multithreading and multiprocessing, and discusses recent efforts to make the GIL optional and eventually remove it from CPython.
ConcurrencyGILMultithreading
0 likes · 7 min read

This comprehensive guide explores why locks are essential in concurrent programming, explains the principles behind mutexes, semaphores, read‑write locks, and re‑entrant locks, provides Python code examples, discusses common pitfalls like deadlocks, and offers best‑practice strategies for production environments.
ConcurrencySemaphoreSynchronization
0 likes · 22 min read

This article explains why Python’s Global Interpreter Lock limits CPU core usage, introduces the multiprocessing module for parallel execution of CPU‑intensive tasks, and provides step‑by‑step code examples, key concepts, synchronization tools, a real‑world image‑processing case, and best practices to dramatically speed up your programs.
CPU BoundConcurrencyParallelism
0 likes · 9 min read

This comprehensive guide explains Python's multiprocessing module, compares processes with threads, shows how to create and manage processes using Process and Pool classes, covers inter‑process communication, synchronization primitives, async I/O integration, error handling, debugging techniques, and real‑world examples such as web crawlers, data analysis, and game servers.
Interprocess CommunicationProcess Poolasync I/O
0 likes · 28 min read

This article explains how Python's __name__ variable works, why the if __name__ == '__main__' construct is used to differentiate direct script execution from module import, and shows practical examples including simple scripts and multiprocessing scenarios.
if __name__ == '__main__'module importmultiprocessing
0 likes · 5 min read

This article introduces a range of Python performance‑optimization methods—including built‑in functions, list comprehensions, generator expressions, avoiding globals, functools.lru_cache, NumPy, pandas, multiprocessing, Cython, PyPy, and line_profiler—illustrated with clear code examples and a practical image‑processing case study.
built-in functionslist comprehensionmultiprocessing
0 likes · 8 min read


21CTOOct 19, 2024 · Fundamentals
Python's Global Interpreter Lock (GIL) serializes thread execution to protect memory, but in today's multicore era it creates performance bottlenecks; this article explains what the GIL is, why it exists, its impact on multithreading, and how multiprocessing can bypass its limitations.
GILMultithreadingPython
0 likes · 6 min read

This article explains why traditional Python multithreading tutorials are often overly complex, introduces the concise map‑based approach using multiprocessing and multiprocessing.dummy ThreadPool, demonstrates performance gains with real‑world examples, and provides ready‑to‑run code snippets for efficient parallel execution.
Parallelismmapmultiprocessing
0 likes · 10 min read

This guide explains Python's multithreading and multiprocessing concepts, compares thread pools and process pools, provides practical code examples for task execution and file downloading, and offers best‑practice advice for efficient concurrent programming.
ConcurrencyMultithreadingProcessPoolExecutor
0 likes · 14 min read

This tutorial demonstrates how to accelerate processing of a multi‑million‑row CSV dataset by dividing the work into parallel tasks using Python's multiprocessing, joblib, and tqdm libraries, comparing serial, multi‑process, batch, and process‑map approaches with detailed timing results.
Parallel ProcessingPythondata cleaning
0 likes · 8 min read


21CTOMay 18, 2024 · Fundamentals
This article traces the history of the Python Global Interpreter Lock, explains why it remains a performance bottleneck, and examines recent efforts such as multiprocessing, PEP 554, and sub‑interpreters that aim to mitigate or eliminate the GIL in CPython.
CPythonConcurrencyGIL
0 likes · 10 min read

This article provides an in‑depth overview of Python's multiprocessing module, covering process creation, inter‑process communication, synchronization primitives, error handling, debugging tools, and real‑world project examples to help developers efficiently leverage multi‑core CPUs for CPU‑bound tasks.
ConcurrencyInterprocess Communicationasync IO
0 likes · 25 min read

This comprehensive guide explains Python’s multiprocessing module, covering process creation, inter‑process communication, pools, synchronization primitives, error handling, and real‑world examples such as web crawlers, data analysis, and game servers, helping developers harness multiple CPU cores to boost performance and avoid GIL limitations.
Code ExamplesParallelismPython
0 likes · 32 min read

This article introduces Python concurrency programming, explaining how to use multithreading, multiprocessing, thread and process pools, async/await, coroutines, and producer‑consumer models with code examples, helping developers improve performance and responsiveness for time‑consuming tasks and concurrent network requests.
ConcurrencyMultithreadingasyncio
0 likes · 5 min read

This article explains ten different Python multiprocessing techniques—Pipe, Queue, shared memory, shared variables, events, semaphores, condition variables, shared queues, shared dictionaries, and shared counters—each illustrated with complete code examples for inter‑process communication.
Code ExamplesConcurrencyIPC
0 likes · 7 min read

This article introduces Python's multiprocessing module and the Celery task queue, explains their core concepts, and provides practical code examples for multi‑process parallel computation, inter‑process communication, asynchronous execution, scheduled jobs, result callbacks, retries, and distributed task orchestration.
Distributed TasksPythonTask Queue
0 likes · 7 min read

This article explains the fundamental differences between threads and processes, the role of Python's Global Interpreter Lock (GIL), and provides a comprehensive guide to using the multiprocessing module, its components, synchronization primitives, and the concurrent.futures API for parallel execution in Python.
ConcurrencyGILParallelism
0 likes · 36 min read

This article introduces Python's multiprocessing module and the Celery distributed task queue, explains their core features, and provides ten practical code examples demonstrating multi‑process parallel computation, inter‑process communication, asynchronous tasks, scheduling, retries, and distributed processing for real‑world applications.
Distributed TasksPythoncelery
0 likes · 7 min read

This tutorial demonstrates how to accelerate processing of a 2.8‑million‑row CSV dataset by using Python's multiprocessing, joblib, and tqdm libraries, covering serial, parallel, and batch processing techniques, performance measurements, and best‑practice code examples for efficient large‑scale data handling.
Data EngineeringParallel ProcessingPython
0 likes · 9 min read

This article explains Python's multiprocessing module, shows how to create and manage processes and process pools with clear code samples, and outlines common use cases, best practices, and pitfalls for efficiently handling CPU‑bound tasks.
ConcurrencyProcess Poolmultiprocessing
0 likes · 7 min read

This article explains how to use a Python program to parse Tencent video URLs, retrieve the cached TS segments via HTTP requests, download them concurrently with multiprocessing, and finally merge the segments into a playable MP4 file, including environment setup and full source code.
multiprocessingrequeststs-to-mp4
0 likes · 8 min read

This article introduces parallel programming concepts, memory architectures, execution models, Python threading versus multiprocessing performance, and reviews several Python parallel libraries such as Ray, Dask, Dispy, ipyparallel, and Joblib for building scalable concurrent applications.
MultithreadingParallel ProgrammingPython
0 likes · 10 min read

This article demonstrates how to boost the speed of image‑preprocessing tasks in Python by replacing a conventional single‑process loop with a three‑line concurrent.futures ProcessPoolExecutor implementation, achieving up to six‑fold performance gains on multi‑core CPUs.
concurrent.futuresdata-preprocessingimage-processing
0 likes · 7 min read

This tutorial demonstrates how to accelerate processing of a multi‑million‑row CSV dataset by splitting the work into sub‑tasks and applying Python's multiprocessing, joblib, and tqdm libraries for serial, parallel, and batch processing, showing significant speed‑ups and best‑practice code snippets.
Parallel ProcessingPythonbig data
0 likes · 10 min read

This article explains a common Python multiprocessing pitfall, showing how using target=function_name without parentheses correctly launches a new process, and illustrates the difference between passing a function object versus calling the function, accompanied by screenshots of the discussion, runtime output, and a concise solution.
ConcurrencyTutorialmultiprocessing
0 likes · 3 min read

This article explains how to compute indirect shareholding ratios between companies by generating synthetic relationship data, cleaning and normalizing it with multiprocessing, constructing a weighted directed graph using NetworkX, and applying a matrix‑based algorithm to derive the final ownership matrix.
Pythondata processinggraph-analysis
0 likes · 7 min read

This article walks through a step‑by‑step Python web‑scraping tutorial that fetches financial data of over 3000 listed companies from a public website, parses the tables with pandas, enhances the script with error handling, URL flexibility, MySQL storage, and multiprocessing to speed up the crawl.
Pandasdata-extractionmultiprocessing
0 likes · 8 min read

This article critiques heavyweight Python threading tutorials, explains why the built‑in map function combined with multiprocessing or multiprocessing.dummy offers a concise, efficient way to parallelize I/O‑ and CPU‑bound tasks, and demonstrates dramatic speed‑ups with real code examples.
ParallelismPythonmap function
0 likes · 13 min read

This article explains how Python concurrency can boost program performance, covering multithreading, multiprocessing, the Global Interpreter Lock, thread safety, thread pools, and practical code examples for speeding up I/O‑bound and CPU‑bound tasks.
GILMultithreadingPython
0 likes · 15 min read

This article explains the fundamental differences between threads and processes, the role of Python's Global Interpreter Lock, and provides a comprehensive guide to using the multiprocessing and concurrent.futures modules—including their main classes, synchronization primitives, and practical code examples—for effective concurrent programming in Python.
ConcurrencyGILMultithreading
0 likes · 40 min read

This article introduces Python process concepts, including process creation with the multiprocessing module, process states, comparison with threads, and practical examples of creating, managing, and communicating with processes, followed by a comprehensive overview of Python list types, their structure, operations, and common usage patterns.
Process ManagementPythonThread Comparison
0 likes · 26 min read


21CTOJan 1, 2022 · Fundamentals
This article provides a comprehensive guide to Python concurrency, covering the fundamental differences between threads and processes, the impact of the Global Interpreter Lock, and detailed usage of the multiprocessing module with its various components and synchronization primitives.
ConcurrencyGILmultiprocessing
0 likes · 38 min read

This article explains the fundamental differences between threads and processes, the role of Python's Global Interpreter Lock (GIL), and how to use the multiprocessing package—including Process, Pool, Queue, Pipe, and synchronization primitives—as well as an overview of concurrent.futures for high‑level concurrent programming in Python.
ConcurrencyGILPython
0 likes · 38 min read

This article explains the differences between processes and threads, the advantages of using multiple processes in Python, and provides step‑by‑step code examples—including basic process creation, subclassing Process, inter‑process communication with queues, process pools, and a practical file‑copying case study—to help readers master multiprocessing for efficient concurrent programming.
Code ExamplesConcurrencyThread
0 likes · 11 min read

This article explains how to use Python's multiprocessing module to parallelize a custom preprocessing function on a 537k‑record dataset, demonstrating roughly a thirty‑fold reduction in execution time compared with single‑process execution.
Parallel Processingbenchmarkbig data
0 likes · 6 min read

This article explains the concepts of processes and threads, compares their characteristics, outlines their respective advantages and disadvantages, and provides practical guidelines for choosing between multithreading and multiprocessing in software design.
ConcurrencyMultithreadingThread
0 likes · 16 min read

This article explains why processes are preferred over threads for stability and multi‑machine distribution, introduces Python's multiprocessing.managers for networked task queues, and provides step‑by‑step code examples to create a distributed crawler that fetches image URLs and downloads them across several machines.
Process ManagementPythonmultiprocessing
0 likes · 6 min read

This article explains Python's multiprocessing module, covering process concepts, creation of single and multiple processes, process pools, locks, inter‑process communication methods such as Event, Pipe, Queue, semaphores, and data sharing techniques, with code examples and visual illustrations.
ConcurrencyIPCLocks
0 likes · 13 min read

This article critiques traditional Python threading tutorials and demonstrates how to replace verbose thread‑pool code with concise map‑based parallelism using multiprocessing and multiprocessing.dummy, providing practical examples, performance measurements, and guidelines for choosing pool sizes for I/O‑ and CPU‑bound tasks.
ConcurrencyParallelismmap
0 likes · 11 min read

This article explains the fundamentals of parallel computing in the big‑data era, compares parallelism and concurrency, outlines GPU and distributed‑computing solutions, and provides a detailed guide to Python’s multiprocessing module with code examples, performance tests, and practical tips.
GPUPythonbig data
0 likes · 18 min read

This article walks through creating a Python web scraper that extracts financial data for over three thousand listed companies, starting from a simple pandas script and progressively adding error handling, MySQL storage, and multiprocessing to build a robust, production‑ready tool.
MySQLPythondata-extraction
0 likes · 7 min read

This article explains why traditional Python threading tutorials are often over‑engineered, introduces the concise map‑based parallelism using multiprocessing and multiprocessing.dummy, and demonstrates how a few lines of code can dramatically speed up I/O‑bound and CPU‑bound tasks.
ConcurrencyParallelismThreadPool
0 likes · 11 min read

This article provides a comprehensive guide to Python's multiprocessing module, covering how to create and manage processes, use join for synchronization, configure daemon processes, and employ synchronization primitives such as Lock, Semaphore, Event, and Queue for safe inter‑process communication, with complete code examples.
ConcurrencyInterprocess CommunicationPython
0 likes · 12 min read

This article demonstrates how to build a Python web scraper for Toutiao that leverages a multiprocessing pool, identifies AJAX endpoints, fetches JSON data, extracts titles and image URLs, handles Unicode encoding, and downloads images into organized folders.
AJAXPythonToutiao
0 likes · 13 min read

This article explains the producer‑consumer pattern, why it is needed, and demonstrates two Python implementations using a standard Queue and a JoinableQueue, including full code samples, execution results, and discussion of graceful termination for multiple consumers.
ConcurrencyJoinableQueueProducer-Consumer
0 likes · 8 min read

A comprehensive guide that explains Python concurrency concepts—including processes, threads, synchronization primitives, thread pools, asyncio, greenlet, and gevent—while showing how to choose the right model for CPU‑bound or I/O‑bound tasks.
ConcurrencyMultithreadingPython
0 likes · 71 min read

This article explains the concepts of processes and threads in Python, compares multi‑process, multi‑thread, and combined approaches, shows how to use fork, the multiprocessing module, process pools, subprocesses, and inter‑process communication with queues, and provides complete code examples with results.
ConcurrencyIPCPython
0 likes · 15 min read

This article explains how to create and manage multiple processes in Python using the os.fork method, the multiprocessing module's Process and Pool classes, and demonstrates inter‑process communication with Queue and Pipe, providing clear code examples for both Unix/Linux and cross‑platform environments.
IPCPythonfork
0 likes · 10 min read

This article critiques traditional Python multithreading tutorials and demonstrates how the built‑in map function together with multiprocessing.dummy's ThreadPool can dramatically speed up I/O‑bound and CPU‑bound tasks, offering concise code examples, performance benchmarks, and a real‑world thumbnail generation case study.
ParallelismThreadPoolmap
0 likes · 11 min read

This guide details how to configure a CentOS 7.1 server with GNOME, VNC, Chrome, Python, Selenium and Chromedriver for web UI automation testing, and explains using Python's multiprocessing to run tests concurrently across multiple browsers, dramatically reducing regression time.
CentOSPythonmultiprocessing
0 likes · 5 min read

This article presents 20 practical Python performance tips—from choosing O(1) data structures and reducing redundant data to leveraging generators, C extensions, multiprocessing, and profiling tools—complete with benchmark code snippets that demonstrate measurable speed gains across common coding patterns.
C extensionsPythonmultiprocessing
0 likes · 16 min read

This step‑by‑step tutorial shows Python beginners how to create a simple web scraper that downloads, parses, and stores the Maoyan movie TOP 100 list using requests, regular expressions, and multiprocessing for fast data collection.
Pythonmultiprocessingregex
0 likes · 5 min read

This article explains Python's inter-process communication methods, including process creation, queues, pipes, locks, and pools, and introduces coroutines as lightweight alternatives, detailing their creation with gevent, practical web crawling, and socket server implementations, highlighting performance benefits and appropriate use cases.
ConcurrencyPythoncoroutine
0 likes · 6 min read

Inspired by a tutorial, I created a MongoDB‑backed crawler for the Yisou novel website, extracting category links, managing URL states across multiple processes, handling millions of pages, and finally deduplicating the results to obtain a clean collection of books.
MongoDBPythoncrawling
0 likes · 3 min read


21CTOAug 5, 2017 · Backend Development
This article walks through solving a massive log‑keyword counting task—600,000 short messages and 50,000 keywords—by evolving from a simple grep‑based approach to regex optimizations, word‑splitting, a trie data structure, and finally a multi‑process Redis queue, achieving a performance boost from hours to under ten minutes.
Triegreplog processing
0 likes · 15 min read

This article explains the differences between Ruby threads and processes, when to use each for performance gains, illustrates practical scenarios, and provides code examples for simple multithreading, multiprocessing, and using the Parallel gem.
ConcurrencyGILMultithreading
0 likes · 11 min read


ITPUBApr 6, 2016 · Fundamentals
This article explains the purpose of Python’s Global Interpreter Lock, how it limits multithreaded performance on multi‑core CPUs, distinguishes CPU‑bound versus I/O‑bound scenarios, and shows why multiprocessing is usually the preferred solution for parallel execution.
ConcurrencyGILMultithreading
0 likes · 6 min read


21CTOApr 4, 2016 · Backend Development
This article explores two PHP multi‑process architectures for rapidly retrieving page titles from hundreds of URLs, comparing a simple socket‑based server with a threaded URL‑batch processor, and discusses performance trade‑offs, memory usage, and scalability considerations.
BackendPHPmultiprocessing
0 likes · 5 min read

This article explains how to use Python's multiprocessing module to achieve true parallelism, covering Process creation, inter‑process synchronization primitives such as Lock, Semaphore, Event, communication tools like Queue and Pipe, and advanced patterns with Pool, all illustrated with runnable code examples.
ConcurrencyLockPool
0 likes · 17 min read
