tree: a773acaffadbbc827d5f8b12feb54ede90342e07 [path history] [tgz]
  1. OWNERS
  2. README.md
  3. task.cc
  4. task.h
  5. task.idl
  6. task_worklet.cc
  7. task_worklet.h
  8. task_worklet.idl
  9. task_worklet_global_scope.cc
  10. task_worklet_global_scope.h
  11. task_worklet_global_scope.idl
  12. thread_pool.cc
  13. thread_pool.h
  14. thread_pool_thread.cc
  15. thread_pool_thread.h
  16. window_task_worklet.h
  17. window_task_worklet.idl
  18. worker_task_queue.cc
  19. worker_task_queue.h
  20. worker_task_queue.idl
third_party/blink/renderer/core/workers/experimental/README.md

This directory contains experimental APIs for farming tasks out to a pool of worker threads. Everything in this directory is still highly in flux, and is not anywhere near ready to ship.

thread_pool.{h,cc} contain a class that manages a pool of worker threads and can distribute work to them. thread_pool_thread.{h,cc} is a subclass of WorkerThread that these distirubted tasks run on.

worker_task_queue.{h,cc,idl} exposes two APIs:

  • postFunction - a simple API for posting a task to a worker.
  • postTask - an API for posting tasks that can specify other tasks as prerequisites and coordinates the transfer of return values of prerequisite tasks to dependent tasks

task_worklet.{h,cc,idl}, task_worklet_global_scope.{h,cc,idl}, and window_task_worklet.{h,idl} exposes a similar API to WorkerTaskQueue, built on top of the Worklet API. In addition to implementing postTask() just like WorkerTaskQueue, it includes addModule() (inherited from Worklet) and a second variant of postTask(). Modules loaded via addModule() can call registerTask() to specify a name and class with a process() function, and this second variant of postTask() takes a task name instead of a function. If a task is registered with that given task name, its process() function will be called with the given parameters.

task.{h,cc,idl} exposes the simple wrapper object returned by postTask and provides the backend that runs tasks on the worker thread (for both postFunction and postTask) and tracks the relationships between tasks (for postTask).