| Package | Description |
|---|---|
| net.lecousin.framework.concurrent |
Multi-threading framework.
|
| net.lecousin.framework.concurrent.async |
Classes implementing synchronization points such as asynchronous result, join point...
|
| Modifier and Type | Class and Description |
|---|---|
class |
Task.Output
Synchronization point holding the result or error of this task.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
IAsync<TError extends Exception>
Base interface for an asynchronous unit.
An asynchronous unit can have 4 states: Blocked: this is the first state, until something happens (resource available, task done...) Unblocked with error: when an error occurs (while processing the task, if the waited resource cannot be obtained, or if the underlying process was itself waiting for an asynchronous unit that raised an error) Unblocked with cancellation: when explicitly cancelled or because the underlying process was itself waiting for an asynchronous unit that has been cancelled. Unblocked with success The state can be consulted using methods IAsync.isDone(), IAsync.hasError() and isCancelled().Listeners can be added to be called when the asynchronous unit is unblocked. |
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractLock<TError extends Exception>
Base class for locks.
|
class |
Async<TError extends Exception>
Simplest implementation of a synchronization point.
|
class |
AsyncSupplier<T,TError extends Exception>
Same as a SynchronizationPoint, except that it contains a result.
|
class |
JoinPoint<TError extends Exception>
A JoinPoint allows to wait for several synchronization points or events, instead of a single one.
|
class |
LockPoint<TError extends Exception>
A LockPoint is similar to a mutual exclusion, but can be locked and unlocked by any thread.
For example, a first thread can lock it, and a second thread (after some processing is done) can unlock it. A LockPoint can also be seen as a SynchronizationPoint but reusable. When a thread calls the lock method: if the lock point is not yet locked it becomes locked and the calling thread can continue working, and must call the method unlock once done. if the lock point is already locked, the calling thread is paused, waiting for the lock point to be unlocked. If several threads are waiting for the lock point to be unlocked: Only one is resume and obtain the lock, the others are still paused The order the threads are resumed is undetermined, meaning it is not necessarily in the order they called the lock method |
class |
MutualExclusion<TError extends Exception>
A MutualExclusion must be unlocked by the same thread that locked it.
|
class |
WaitingDataQueueSynchronizationPoint<DataType,TError extends Exception>
Like a SynchronizationPoint, but with a queue of waiting data.
|
Copyright © 2019. All rights reserved.