
This CL contains three demos showing how to use //base scheduling and threading primitives. `See codelabs/threading_and_scheduling/README.md` for detailed documentation of this CL's additions. 01-single-task-queue: This first example is pretty trivial, it just shows the basics of creating a SequenceManager, TaskQueue, TaskRunner, and posting a task. 02-task-queue-priorities: This example demonstrates that multiple TaskQueues can be multiplexed within the same SequenceManager on a particular thread. It shows that "TaskQueue" is the principal unit of scheduling/ordering. That is, non-delayed tasks posted to the same TaskQueue are guaranteed to run in FIFO order, but tasks posted to different TaskQueues are run according to queue priorities. 03-randomized-task-queues: This example is similar to the last one, except we use two same priority TaskQueues that have their scheduling order randomized, to further demonstrate that the the task execution ordering *across* TaskQueues cannot be relied upon, while non-delayed tasks posted to the same TaskQueue are still guaranteed to run in FIFO order. This example is carried out by setting a random seed which randomizes which TaskQueue that gets served by the thread's SequenceManager at any given time. This is not the default setting in Chrome/base. 04-multiple-threads: This third example showcases how to post tasks to other threads. It builds off of the preexisting `codelabs/cpp101/factor.cc` example by not delegating to the ThreadPool, but by showing how to: - Set up multiple SequenceManagers (bound and unbound) - Use the base::Thread API with a custom delegate - Register TaskQueues on each thread - Post cross-thread delayed tasks Bug: N/A Change-Id: Ie36bad7f7c2b2682591d1ba83f48eccbdc0f8f81 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2384135 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Austin Sullivan <asully@chromium.org> Commit-Queue: Dominic Farolino <dom@chromium.org> Cr-Commit-Position: refs/heads/main@{#1088717}
Chromium
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone
! Instead,
follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.