Skip to content

Commit f4c6ece

Browse files
author
Daniel
committed
Concurrency: high priority
1 parent 130d382 commit f4c6ece

40 files changed

Lines changed: 845 additions & 1702 deletions

TOPICS_PLAN.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,32 @@ src/main/java/org/nkcoder/
2222

2323
## Topic Details
2424

25-
### 1. concurrency/ - Multithreading & Concurrency
25+
### 1. concurrency/ - Multithreading & Concurrency (Java 25)
26+
27+
**Stable (Production-Ready):**
28+
29+
| Sub-package | Status | Examples | Concepts |
30+
|--------------|--------|-------------------------------|------------------------------------------|
31+
| virtual/ | [x] | VirtualThreadExample | Virtual threads, I/O-bound concurrency |
32+
| scoped/ | [x] | ScopedValueExample | ScopedValue (replaces ThreadLocal) |
33+
34+
**Preview (Experimental - API may change):**
35+
36+
| Sub-package | Status | Examples | Concepts |
37+
|--------------|--------|-------------------------------|------------------------------------------|
38+
| preview/ | [x] | StructuredConcurrencyExample | StructuredTaskScope, Joiner (5th preview)|
39+
40+
**Foundational (To Add Later):**
2641

2742
| Sub-package | Status | Examples | Concepts |
2843
|-------------------------|--------|---------------------------------------------------------------|--------------------------------------------|
29-
| thread/ | [x] | ThreadExample, DaemonThreadExample | Thread creation, lifecycle, daemon threads |
30-
| synchronization/ | [x] | SynchronizedExample, VolatileExample, WaitNotifyExample | synchronized, volatile, wait/notify |
31-
| locks/ | [x] | ReentrantLockDemo, ReadWriteLockExample, LockSupportExample | ReentrantLock, ReadWriteLock, Conditions |
32-
| atomic/ | [x] | AtomicIntegerExample, AtomicReferenceExample | Atomic classes, CAS operations |
33-
| executors/ | [x] | FixThreadPool, ScheduledThreadPool, ThreadPoolExecutor | ExecutorService, thread pools |
34-
| concurrent_collections/ | [x] | ConcurrentHashMapExample, CopyOnWriteListExample | Thread-safe collections |
35-
| utilities/ | [x] | CountDownLatchExample, CyclicBarrierExample, SemaphoreExample | Synchronization utilities |
36-
| unsafe/ | [x] | ArrayListUnSafe, HashMapUnSafe | Thread-safety issues demonstration |
37-
| virtual/ | [ ] | VirtualThreadExample, VirtualVsPlatformExample | Virtual threads (Java 21) |
38-
| structured/ | [ ] | StructuredConcurrencyExample | Structured concurrency (Java 21) |
44+
| thread/ | [ ] | ThreadExample, DaemonThreadExample | Thread creation, lifecycle, daemon threads |
45+
| synchronization/ | [ ] | SynchronizedExample, VolatileExample, WaitNotifyExample | synchronized, volatile, wait/notify |
46+
| locks/ | [ ] | ReentrantLockDemo, ReadWriteLockExample | ReentrantLock, ReadWriteLock |
47+
| atomic/ | [ ] | AtomicIntegerExample, AtomicReferenceExample | Atomic classes, CAS operations |
48+
| executors/ | [ ] | ExecutorServiceExample, CompletableFutureExample | ExecutorService, async programming |
49+
| concurrent_collections/ | [ ] | ConcurrentHashMapExample, CopyOnWriteListExample | Thread-safe collections |
50+
| utilities/ | [ ] | CountDownLatchExample, SemaphoreExample | Synchronization utilities |
3951

4052
---
4153

@@ -151,7 +163,7 @@ src/main/java/org/nkcoder/
151163

152164
| Topic | Status | Progress |
153165
|--------------|-------------|----------|
154-
| concurrency | In Progress | 8/10 |
166+
| concurrency | In Progress | 3/10 |
155167
| collections | Complete | 6/6 |
156168
| streams | Complete | 4/4 |
157169
| fp | Complete | 6/6 |
@@ -161,4 +173,4 @@ src/main/java/org/nkcoder/
161173
| generics | Not Started | 0/5 |
162174
| exceptions | Not Started | 0/4 |
163175
| io | Not Started | 0/3 |
164-
| **Total** | | **30/55**|
176+
| **Total** | | **25/55**|

build.gradle.kts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ java {
1111
}
1212
}
1313

14+
15+
// For preview features
16+
tasks.withType<JavaCompile> {
17+
options.compilerArgs.addAll(listOf("--enable-preview", "-Xlint:preview"))
18+
}
19+
20+
tasks.withType<JavaExec> {
21+
jvmArgs("--enable-preview")
22+
}
23+
1424
repositories {
1525
mavenCentral()
1626
}
@@ -23,4 +33,4 @@ dependencies {
2333

2434
tasks.test {
2535
useJUnitPlatform()
26-
}
36+
}

src/main/java/org/nkcoder/concurrency/atomic/AtomicFieldUpdaterExample.java

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/main/java/org/nkcoder/concurrency/atomic/AtomicIntegerArrayExample.java

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/main/java/org/nkcoder/concurrency/atomic/AtomicIntegerExample.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/main/java/org/nkcoder/concurrency/atomic/AtomicReferenceExample.java

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/main/java/org/nkcoder/concurrency/atomic/AtomicStampedReferenceExample.java

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/main/java/org/nkcoder/concurrency/concurrent_collections/ConcurrentLinkedQueueExample.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/main/java/org/nkcoder/concurrency/concurrent_collections/CopyOnWriteListExample.java

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)