Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Issue 1919733002: New task queueing primitive for async tasks: TaskQueue. (Closed)

Created:
4 years, 8 months ago by tommi
Modified:
4 years, 7 months ago
Reviewers:
perkj_webrtc
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

New task queueing primitive for async tasks: TaskQueue. TaskQueue is a new way to asynchronously execute tasks sequentially in a thread safe manner with minimal locking. The implementation uses OS supported APIs to do this that are compatible with async IO notifications from things like sockets and files. This class is a part of rtc_base_approved, so can be used by both the webrtc and libjingle parts of the WebRTC library. Moving forward, we can replace rtc::Thread and webrtc::ProcessThread with this implementation. NOTE: It should not be assumed that all tasks that execute on a TaskQueue, run on the same thread. E.g. on Mac and iOS, we use GCD dispatch queues which means that tasks might execute on different threads depending on what's the most efficient thing to do. Committed: https://crrev.com/0c9df5e5689c8d834149ffc673c04e4216a4a774 Cr-Commit-Position: refs/heads/master@{#12561}

Patch Set 1 #

Patch Set 2 : Fix variable destruction order in PostALot #

Total comments: 34

Patch Set 3 : Address comments #

Total comments: 14

Patch Set 4 : Update docs and add support for cleanup lambdas #

Total comments: 4

Patch Set 5 : Address comments+handle error reported by tsan #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1310 lines, -8 lines) Patch
M webrtc/base/BUILD.gn View 2 chunks +17 lines, -0 lines 0 comments Download
M webrtc/base/base.gyp View 2 chunks +19 lines, -0 lines 0 comments Download
M webrtc/base/base_tests.gyp View 1 chunk +1 line, -0 lines 0 comments Download
A webrtc/base/task_queue.h View 1 2 3 4 1 chunk +281 lines, -0 lines 0 comments Download
A webrtc/base/task_queue_gcd.cc View 1 2 1 chunk +167 lines, -0 lines 0 comments Download
A webrtc/base/task_queue_libevent.cc View 1 2 3 4 1 chunk +318 lines, -0 lines 0 comments Download
A + webrtc/base/task_queue_posix.h View 1 chunk +22 lines, -8 lines 0 comments Download
A webrtc/base/task_queue_posix.cc View 1 chunk +40 lines, -0 lines 0 comments Download
A webrtc/base/task_queue_unittest.cc View 1 2 3 4 1 chunk +261 lines, -0 lines 0 comments Download
A webrtc/base/task_queue_win.cc View 1 2 1 chunk +184 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (7 generated)
tommi
4 years, 8 months ago (2016-04-25 08:23:51 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1919733002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1919733002/1
4 years, 8 months ago (2016-04-25 08:24:10 UTC) #4
tommi
Fix variable destruction order in PostALot
4 years, 8 months ago (2016-04-25 08:42:22 UTC) #5
nisse-webrtc
Maybe you want to have a look at https://www.kernel.org/doc/Documentation/workqueue.txt and see if there are any ...
4 years, 8 months ago (2016-04-25 08:50:49 UTC) #6
perkj_webrtc
ok- I started... Looks good. https://codereview.webrtc.org/1919733002/diff/20001/webrtc/base/task_queue.h File webrtc/base/task_queue.h (right): https://codereview.webrtc.org/1919733002/diff/20001/webrtc/base/task_queue.h#newcode74 webrtc/base/task_queue.h:74: class TaskQueue { please ...
4 years, 8 months ago (2016-04-26 14:30:38 UTC) #7
perkj_webrtc
https://codereview.webrtc.org/1919733002/diff/20001/webrtc/base/task_queue_win.cc File webrtc/base/task_queue_win.cc (right): https://codereview.webrtc.org/1919733002/diff/20001/webrtc/base/task_queue_win.cc#newcode44 webrtc/base/task_queue_win.cc:44: PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE); Why PeekMessage here? https://codereview.webrtc.org/1919733002/diff/20001/webrtc/base/task_queue_win.cc#newcode119 ...
4 years, 7 months ago (2016-04-28 09:58:32 UTC) #8
tommi
Address comments
4 years, 7 months ago (2016-04-28 12:03:40 UTC) #9
tommi
https://codereview.webrtc.org/1919733002/diff/20001/webrtc/base/task_queue.h File webrtc/base/task_queue.h (right): https://codereview.webrtc.org/1919733002/diff/20001/webrtc/base/task_queue.h#newcode74 webrtc/base/task_queue.h:74: class TaskQueue { On 2016/04/26 14:30:37, perkj_webrtc wrote: > ...
4 years, 7 months ago (2016-04-28 12:04:02 UTC) #10
perkj_webrtc
I would like to take a last look at the linux implementation another day. But ...
4 years, 7 months ago (2016-04-28 14:40:18 UTC) #11
tommi
Update docs and add support for cleanup lambdas
4 years, 7 months ago (2016-04-28 15:30:01 UTC) #12
tommi
https://codereview.webrtc.org/1919733002/diff/40001/webrtc/base/task_queue.h File webrtc/base/task_queue.h (right): https://codereview.webrtc.org/1919733002/diff/40001/webrtc/base/task_queue.h#newcode156 webrtc/base/task_queue.h:156: // TODO(tommi): Should we expose this variant publicly On ...
4 years, 7 months ago (2016-04-28 15:30:34 UTC) #13
perkj_webrtc
lgtm with the below considered. I would like to know what you think about just ...
4 years, 7 months ago (2016-04-29 07:29:44 UTC) #14
tommi
Address comments+handle error reported by tsan
4 years, 7 months ago (2016-04-29 08:41:41 UTC) #15
tommi
https://codereview.webrtc.org/1919733002/diff/60001/webrtc/base/task_queue_unittest.cc File webrtc/base/task_queue_unittest.cc (right): https://codereview.webrtc.org/1919733002/diff/60001/webrtc/base/task_queue_unittest.cc#newcode71 webrtc/base/task_queue_unittest.cc:71: queue.PostTask(std::unique_ptr<QueuedTask>(&my_task)); On 2016/04/29 07:29:44, perkj_webrtc wrote: > Would it ...
4 years, 7 months ago (2016-04-29 09:56:24 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1919733002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1919733002/80001
4 years, 7 months ago (2016-04-29 09:59:10 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_rel on tryserver.webrtc (JOB_TIMED_OUT, no build URL)
4 years, 7 months ago (2016-04-29 10:42:19 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1919733002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1919733002/80001
4 years, 7 months ago (2016-04-29 10:51:23 UTC) #23
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 7 months ago (2016-04-29 11:49:10 UTC) #24
tommi
A revert of this CL (patchset #5 id:80001) has been created in https://codereview.webrtc.org/1935483002/ by tommi@webrtc.org. ...
4 years, 7 months ago (2016-04-29 13:03:06 UTC) #25
commit-bot: I haz the power
4 years, 7 months ago (2016-05-01 22:01:53 UTC) #27
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/0c9df5e5689c8d834149ffc673c04e4216a4a774
Cr-Commit-Position: refs/heads/master@{#12561}

Powered by Google App Engine
This is Rietveld 408576698