5dc7fa709646799a5207a5d217f70aa02bf4a3aa
This API can be used to run arbitrary tasks on a pool of worker
threads. The number of threads is calculated based on the number
of CPU cores available.
The API is made of 3 classes:
TaskManager
Creates and manages the worker threads.
Task
Describes the work to be done and the type of the output.
A task contains a future used to wait for the worker thread
to be done computing the result of the task.
TaskProcessor
The processor dispatches tasks to the TaskManager and is
responsible for performing the computation required by
each task. A processor will only be asked to process tasks
sent to the manager through the processor.
A typical use case:
class MyTask: Task<MyType>
class MyProcessor: TaskProcessor<MyType>
TaskManager m = new TaskManager();
MyProcessor p = new MyProcessor(m);
MyTask t = new MyTask();
p.add(t);
// Waits until the result is available
MyType result = t->getResult();
Change-Id: I1fe845ba4c49bb0e1b0627ab147f9a861c8e0749
am
22bcc39b: am 5c748fa5: am 5cb405bc: am 679fe25b: am a15afd2b: resolve a few doc issues from external reports
cherrypick from ics-mr1 docs: source for nw app Change-Id: If50f407a0e56fa802fe9beedaa650e3a131872b2
…
Description
No description provided
Languages
Java
73.7%
Kotlin
14%
PowerBuilder
5.8%
C++
5.2%
AIDL
1%