0
Go to file
Dominic Farolino 73b6874ced Codelabs: Add //base threading & scheduling examples
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}
2023-01-04 15:00:06 +00:00
2023-01-04 12:11:29 +00:00
2022-11-22 09:04:26 +00:00
2023-01-04 14:16:56 +00:00
2022-12-22 23:40:33 +00:00

Logo 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.

Description
Chromium是一个开源浏览器项目,提供了一种安全、快速、稳定的方法来体验Web。该浏览器可以在多个平台上下载,包括Mac、Windows、Linux和ChromiumOS。项目原始地址: https://chromium.googlesource.com/chromium/src.git
https://www.mobibrw.com/gitea-mirrors/chromium/src.git
Readme BSD-3-Clause 89 GiB
Languages
C++ 74.4%
Java 8.2%
Objective-C++ 4.6%
TypeScript 4%
Python 2.5%
Other 6.1%