Tag

ThreadSafety

2 views collected around this technical thread.

Architect's Guide
Architect's Guide
May 27, 2025 · Backend Development

Understanding CopyOnWrite (COW) Concept and Its Implementation in Java

The article explains the CopyOnWrite (COW) concept, its read‑write separation benefits for thread‑safe, read‑heavy scenarios, key implementation details in Java’s CopyOnWriteArrayList—including volatile and transient usage—and discusses its memory overhead and eventual‑consistency drawbacks.

ConcurrencyCopyOnWriteDataStructure
0 likes · 5 min read
Understanding CopyOnWrite (COW) Concept and Its Implementation in Java
IT Services Circle
IT Services Circle
Apr 22, 2025 · Backend Development

Effective Date and Time Handling in Java: Pitfalls, Thread Safety, and Advanced Solutions

This article explores common pitfalls in Java date handling such as thread‑unsafe SimpleDateFormat and daylight‑saving issues, and presents robust solutions including ThreadLocal wrappers, Java 8 Date‑Time API, timezone‑aware calculations, caching strategies, and global interceptor designs to ensure safe, performant, and maintainable time processing.

DateTimeJavaPerformance
0 likes · 10 min read
Effective Date and Time Handling in Java: Pitfalls, Thread Safety, and Advanced Solutions
IT Services Circle
IT Services Circle
Mar 9, 2024 · Backend Development

Common Java Date Handling Pitfalls: Leap Year, Formatting, Timezone, and Thread Safety

This article explains several Java date‑time pitfalls—including leap‑year calculations, differences between YYYY/yyyy and HH/hh patterns, SimpleDateFormat initialization, Calendar hour fields, integer overflow in date arithmetic, thread‑unsafe usage of SimpleDateFormat, and daylight‑saving‑time handling—providing code examples and best‑practice recommendations.

BackendDateFormattingDateTime
0 likes · 10 min read
Common Java Date Handling Pitfalls: Leap Year, Formatting, Timezone, and Thread Safety
Top Architecture Tech Stack
Top Architecture Tech Stack
Oct 13, 2023 · Fundamentals

Java Singleton Pattern: Eager, Lazy, Double‑Check Locking, Holder, and Enum Implementations

This article explains several common Java singleton implementations—including lazy ("hungry"), eager, double‑checked locking, holder, and enum patterns—detailing their code, thread‑safety characteristics, performance trade‑offs, and pitfalls such as partial initialization and reflection attacks.

DesignPatternEnumJava
0 likes · 10 min read
Java Singleton Pattern: Eager, Lazy, Double‑Check Locking, Holder, and Enum Implementations
Selected Java Interview Questions
Selected Java Interview Questions
Sep 7, 2023 · Backend Development

Understanding Blocking Queues in Java: Concepts, Types, and Core Methods

Blocking queues are thread‑safe data structures in Java that support blocking operations, enabling producer‑consumer coordination; this article explains their definition, differences from List/Set and regular queues, various implementations such as ArrayBlockingQueue and LinkedBlockingQueue, core methods like take and put, and bounded versus unbounded capacities.

BlockingQueueConcurrencyDataStructure
0 likes · 11 min read
Understanding Blocking Queues in Java: Concepts, Types, and Core Methods
Selected Java Interview Questions
Selected Java Interview Questions
Sep 7, 2022 · Backend Development

Java Date and Time Formatting: Methods, Thread Safety, and Best Practices

This article compares three common Java date‑time formatting approaches—SimpleDateFormat, Java 8’s DateTimeFormatter, and Apache Commons Lang3’s DateFormatUtils—examines thread‑safety issues, provides code examples, and offers conversion utilities between Date, LocalDate, and LocalDateTime for robust backend development.

Apache CommonsBackendDateTime
0 likes · 9 min read
Java Date and Time Formatting: Methods, Thread Safety, and Best Practices
Selected Java Interview Questions
Selected Java Interview Questions
Jan 3, 2022 · Fundamentals

Understanding AtomicInteger: Optimistic Locking and CAS in Java

AtomicInteger provides a thread‑safe, lock‑free counter in Java by employing optimistic locking and CAS operations, offering higher efficiency than synchronized blocks; the article explains its motivation, usage examples, underlying Unsafe mechanisms, volatile semantics, and key methods such as incrementAndGet and compareAndSet.

AtomicIntegerCASConcurrency
0 likes · 7 min read
Understanding AtomicInteger: Optimistic Locking and CAS in Java
Selected Java Interview Questions
Selected Java Interview Questions
Jun 18, 2021 · Fundamentals

Understanding CopyOnWriteArrayList, Vector, and SynchronizedList in Java Concurrency

This article explains the copy‑on‑write optimization, compares Vector, Collections.synchronizedList and CopyOnWriteArrayList, analyzes their fail‑fast behavior, shows how CopyOnWriteArrayList is implemented and iterated, and presents performance benchmarks highlighting their strengths and weaknesses.

ConcurrencyJavaPerformance
0 likes · 14 min read
Understanding CopyOnWriteArrayList, Vector, and SynchronizedList in Java Concurrency
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Jan 24, 2021 · Backend Development

Understanding and Using AtomicReference for Thread‑Safe Updates in Java

This article explains the limitations of volatile for compound updates, demonstrates non‑thread‑safe bank‑account examples, introduces synchronized locking, and then shows how AtomicReference with CAS operations provides a lock‑free, thread‑safe solution, including a deep dive into its internal implementation and related memory‑barrier concepts.

AtomicReferenceCASConcurrency
0 likes · 14 min read
Understanding and Using AtomicReference for Thread‑Safe Updates in Java
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Sep 2, 2020 · Backend Development

Understanding Java Concurrency: Synchronized Containers, OS Concurrency Tools, and Java Concurrency Utilities

This article provides a comprehensive overview of Java concurrency, covering synchronized container classes, operating‑system level synchronization primitives, and the rich set of concurrent utilities introduced in the Java standard library, with code examples and explanations of fail‑fast and fail‑safe mechanisms.

ConcurrencyConcurrentUtilitiesJava
0 likes · 38 min read
Understanding Java Concurrency: Synchronized Containers, OS Concurrency Tools, and Java Concurrency Utilities
Selected Java Interview Questions
Selected Java Interview Questions
Jul 17, 2020 · Fundamentals

Deep Dive into Java ArrayList: Implementation, Thread Safety, and Common Operations

This article provides an in‑depth explanation of Java's ArrayList, covering its purpose, lack of thread safety, detailed source‑code analysis of fields, constructors and core methods, serialization mechanics, capacity handling, and a simplified hand‑written implementation for interview preparation.

ArrayListCodingInterviewDataStructure
0 likes · 13 min read
Deep Dive into Java ArrayList: Implementation, Thread Safety, and Common Operations
Java Captain
Java Captain
Aug 17, 2018 · Fundamentals

Understanding Java ReadWriteLock: Theory, Implementation, and Usage

This article explains why read‑write locks are needed, presents a simple Java implementation, and dives into the inner workings of ReentrantReadWriteLock, covering state encoding, acquisition and release algorithms, lock downgrading, and fairness policies.

AQSConcurrencyJava
0 likes · 18 min read
Understanding Java ReadWriteLock: Theory, Implementation, and Usage
Java Captain
Java Captain
Jun 3, 2018 · Fundamentals

Understanding High Concurrency in Java: Memory Model, Thread Safety, and Synchronization Techniques

This article explores Java high‑concurrency concepts, detailing the Java Memory Model, thread communication, instruction reordering, atomic classes, synchronization mechanisms, lock implementations, concurrent collections, and safe object publication, providing code examples and practical guidance for building robust multithreaded applications.

ConcurrencyJMMJava
0 likes · 18 min read
Understanding High Concurrency in Java: Memory Model, Thread Safety, and Synchronization Techniques