Concurrency - Synchronization

Data System Architecture

About

Synchronization insures thread safety by preventing the same code being run by two different threads at the same time.

When a code (object, method) has a synchronized property, if a thread enter a synchronized method, it will get a lock on it.

It's a lock mechanism but at the code level (not at the state/value leve, see Data Concurrency - Atomic Variable Access)

If an object is visible to more than one thread, all reads or writes to that object's variables must be done through synchronized code.

Synchronization can introduce thread contention, which occurs when two or more threads try to access the same resource simultaneously.

Synchronization has two aspects:

This strategy is effective, but can present problems with liveness.

Synchronize the activities of threads

Warying ways to synchronize the activities of threads.





Discover More
Data System Architecture
Asynchronous programming (Concurrency | Parallel)

application Asynchronous programming is notoriously difficult because the order of operations is highly unpredictable. From a classic computing perspective, concurrent and parallel are clearly synonyms...
Data System Architecture
Concurrency - Lock (Mutex)

A lock is a synchronizationmechanism designed to enforce a mutual exclusion of threads. A lock is also known as a mutex. Type: binary semaphore - yes / no Most locking designs block the execution...
Data System Architecture
Concurrency - Mutex (Mutual exclusion object)

A mutex is a mutual exclusion object that restricts access to a shared resource (e.g. a file) to a single thread instance. The mutual exclusion synchronization between concurrent thread means that: ...
Data System Architecture
Concurrency - Race Condition (Concurrency Problem)

A Race condition is the only concurrent problem that can happen when two threads manipulate the same state (value) in the same time-lapse, the last thread to write the state will overwrite the state modification...
Data System Architecture
Concurrency - Thread Interference (Interleave on shared data)

Same name than ? how errors are introduced when multiple threads access shared data. Interference happens when two operations, running in different threads, but acting on the same data, interleave....
Data System Architecture
Concurrency - Thread Safe

Threads communicate primarily by sharing access to fields and the objects reference fields refer to. This form of communication is extremely efficient, but makes two kinds of errors possible: thread...
Data System Architecture
Data Concurrency - Happens Before relationship

The happens-before relationship is simply a guarantee that memory writes by one specific statement are visible to another specific statement. The results of a write by one thread are guaranteed to be...
Card Puncher Data Processing
Data Integration - Synchronization

duplicate of of ? Ensure that all instances of a repository (database, file system, ...) contain the same data. Its not a trivial task when the data is volatile. Replication is the process of copying...
Java Conceptuel Diagram
Java Concurrency - Synchronization (Thread Safety)

in java. Java offers two basic synchronization idioms: synchronized methods synchronized statements final fields, which cannot be modified after the object is constructed, can be safely read...
Data System Architecture
Parallel Programming - Producer Consumer problem (Bounded-buffer problem)

The producer–consumer problem (also known as the bounded-buffer problem) is a classic example of a multi-process synchronization problem in a producer consumer mode. The problem describes two processes...



Share this page:
Follow us:
Task Runner