Thread State Transition Methods in Java Multithreaded Concurrency
Usage and Differences of wait(), sleep(), yield(), and join()
Throughout this article, "current thread" refers to the thread that currently holds CPU resources and is actively executing.
wait() Method
The wait() method is defined in the Object class. It moves the current thread from the running state to the waiting (blocked) state, an ...
Posted on Fri, 08 May 2026 05:48:23 +0000 by cookspyder
Understanding Threading in Python
Introduction to Concurrent Execution
Concurrent execution allows multiple tasks to run simultaneously, such as browsing the internet, playing music, and writing documents at the same time.
from time import sleep
def perform_singing():
for i in range(3):
print("Singing...%d" % i)
sleep(1)
def perform_dancing():
...
Posted on Fri, 08 May 2026 00:51:42 +0000 by railgun
Implementing Worker Threads in HarmonyOS ArkTS
Worker Thread InitializationImport the worker module and instantiate a thread. For API version 9 and later, utilize ThreadWorker. Earlier versions rely on the deprecated Worker class.import worker from '@ohos.worker';
// API 9+ instantiation
const backgroundTask: worker.ThreadWorker = new worker.ThreadWorker('entry/ets/workers/TaskProcessor.et ...
Posted on Thu, 07 May 2026 23:03:35 +0000 by freewholly
Architecture and Memory Management of Java ThreadLocal
Java's ThreadLocal mechanism provides thread-confined storage by maintaining isolated variable instances per execution thread. Rather then sharing state across threads, it eliminates contention by binding data directly to the executing thread's lifecycle.
Internal Data Structure
The isolation relies on a three-tier architecture: Thread, ThreadL ...
Posted on Thu, 07 May 2026 20:17:58 +0000 by coreyk67
Java Multithreading Fundamentals and Implementation Approaches
Modern operating systems enable concurrent execution of multiple tasks through process management. A process represents an executing program with its own memory space, and the system allocates CPU time slices to each process, allowing them to execute in rotation.
Within each process, threads serve as independent execution paths. A single proces ...
Posted on Thu, 07 May 2026 20:08:17 +0000 by mogster
Common High-Concurrency Patterns in Go
Loop with Select
A frequent idiom in Go for managing concurrent workflows involves an infinite loop combined with a select statement. This pattern enables a goroutine to monitor multiple channels simulteneously and react to whichever becomes ready first.
for {
select {
case msg := <-inputCh:
// Handle incoming message
cas ...
Posted on Thu, 07 May 2026 20:03:20 +0000 by Rollo Tamasi
Understanding Executor Framework vs Direct Thread Creation
The Executor framework decouples thread creation from task execution. Consider the following two implementations:
1: TaskExecutionWebServer.java
package chapter06;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
public class TaskExec ...
Posted on Thu, 07 May 2026 17:57:28 +0000 by Ree
Understanding MySQL MVCC: Implementation and Performance Tuning
Understanding MySQL MVCC: Implementation and Performance Tuning
Core Concepts
Version Chain Mechanism
MVCC enables InnoDB to maintain multiple versions of the same row data. Each modification creates a new version while preserving historical states through a linked structure.
Undo Log Chain: When a row gets updated, InnoDB stores the previous ...
Posted on Thu, 07 May 2026 15:29:12 +0000 by Stephen
Immutable Objects in Java Concurrent Programming
Immutable Objects
Let's examine the date conversion problem first.
@Slf4j(topic = "c.DateParseDemo")
public class DateParseDemo {
public static void main(String[] args) {
runAnalysis();
}
private static void runAnalysis() {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
...
Posted on Thu, 07 May 2026 13:45:29 +0000 by rptasiuk
Implementing Thread-Safe Counters in Java
In concurrent programmnig, a shared counter must be thread-safe to prevent data races and inconsistencies when accessed by multiple threads simultaneously. Two primary approaches to achieve this are using atomic variables and explicit synchronization via locks.
Using AtomicInteger
AtomicInteger provides atomic operations without requiring expli ...
Posted on Thu, 07 May 2026 13:32:40 +0000 by andrewgauger