Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tonywu3027/multithreading-java
My notes and examples on multithreading programming with Java.
https://github.com/tonywu3027/multithreading-java
Last synced: 1 day ago
JSON representation
My notes and examples on multithreading programming with Java.
- Host: GitHub
- URL: https://github.com/tonywu3027/multithreading-java
- Owner: TonyWu3027
- Created: 2024-02-26T10:24:21.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-02-26T10:53:57.000Z (10 months ago)
- Last Synced: 2024-02-26T11:58:22.658Z (10 months ago)
- Language: Java
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Multithreading Java Examples
My notes and examples on multithreading programming with Java.
## Examples
### `SimpleCountDownLatch`
[`simplecountdownlatch.SimpleCountDownLatch`](./src/simplecountdownlatch/SimpleCountDownLatch.java)
is a homegrown
version
of [CountDownLatch](https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/CountDownLatch.html)
that reproduces most of its functionalities with thread-safe guarantee.
We provide two different implementations of the `CountDownLatch` using different inter-thread
communication primitives:- [`simplecountdownlatch.WaitNotifyCountDownLatch`](./src/simplecountdownlatch/WaitNotifyCountDownLatch.java)
is a `SimpleCountDownLatch` implemented with `Object.wait()` and `Obejct.notifyAll()`
- [`simplecountdownlath.ConditionCountDown`](./src/simplecountdownlatch/ConditionCountDownLatch.java)
is a `SimpleCountDownLatch` implemented with `java.util.concurrent.locks.Condition` condition
variable of a reentrant lock