This class is lock free and ensures "safe object publication" between scheduling threads and actual executing thread: if one thread T1 schedules a task, but another thread T2 actually executes it, then all the objects from the T1 thread will be "safely published" to the executing T2 thread. Safe publication is ensured because we are using a ConcurrentLinkedQueue. (see [1], chapter 3.5.3 (Safe publication idioms). [1] Java Concurrency In Practice, Addison Wesley @author Felix Project Team
|
|
|
|