16 Commits

Author SHA1 Message Date
tommi
5bdee47ede Increase tick precision in TaskQueue on Windows 64.
Hopefully this will reduce the flakiness of PostDelayedTask.

BUG=none

Review-Url: https://codereview.webrtc.org/2728663008
Cr-Commit-Position: refs/heads/master@{#17001}
2017-03-03 13:20:12 +00:00
tommi
ede0759c04 Reland of Use TaskQueue in IncomingVideoStream (patchset #1 id:1 of https://codereview.webrtc.org/2714393003/ )
Use TaskQueue in IncomingVideoStream instead of the PlatformThread + event timer approach.

TBR=mflodman@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7219, webrtc:7253

Reland of
686aa37382 (revert)
e2d1d64295 (original)

Review-Url: https://codereview.webrtc.org/2720773002
Cr-Commit-Position: refs/heads/master@{#16872}
2017-02-27 15:16:10 +00:00
tommi
686aa37382 Revert of Use TaskQueue in IncomingVideoStream (patchset #10 id:320001 of https://codereview.webrtc.org/2716473002/ )
Reason for revert:
Reverting while fixing build issue in Chromium.

Original issue's description:
> Use TaskQueue in IncomingVideoStream instead of the PlatformThread + event timer approach.
>
> BUG=webrtc:7219, webrtc:7253
>
> Review-Url: https://codereview.webrtc.org/2716473002
> Cr-Commit-Position: refs/heads/master@{#16860}
> Committed: e2d1d64295

TBR=mflodman@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7219, webrtc:7253

Review-Url: https://codereview.webrtc.org/2714393003
Cr-Commit-Position: refs/heads/master@{#16863}
2017-02-27 13:10:37 +00:00
tommi
e2d1d64295 Use TaskQueue in IncomingVideoStream instead of the PlatformThread + event timer approach.
BUG=webrtc:7219, webrtc:7253

Review-Url: https://codereview.webrtc.org/2716473002
Cr-Commit-Position: refs/heads/master@{#16860}
2017-02-27 12:40:43 +00:00
tommi
8c80c6e389 Fix potential deadlock in TaskQueue's libevent PostTaskAndReply implementation
BUG=webrtc:7188

Review-Url: https://codereview.webrtc.org/2709603002
Cr-Commit-Position: refs/heads/master@{#16786}
2017-02-23 08:34:52 +00:00
tommi
f9d9154808 Add support for multimedia timers to TaskQueue on Windows.
Multimedia timers are higher precision than WM_TIMER, but they're also
a limited resource and more costly. So this implementation is a best
effort implementation that falls back on WM_TIMER when multimedia
timers aren't available.

A possible future change could be to make high precision timers in a
TaskQueue, optional. The reason for doing so would be for TaskQueues
that don't need high precision timers, won't eat up timers from TQ
instances that really need it.

BUG=webrtc:7151

Review-Url: https://codereview.webrtc.org/2691973002
Cr-Commit-Position: refs/heads/master@{#16661}
2017-02-17 10:47:11 +00:00
tommi
67fcad871e Relax the PostDelayed expectations a little more to address flakiness.
BUG=6610
TBR=stefan@webrtc.org
NOTRY=true

Review-Url: https://codereview.webrtc.org/2505083002
Cr-Commit-Position: refs/heads/master@{#15106}
2016-11-16 18:50:28 +00:00
tommi
c5b435dcec Re-enable PostDelayed test for TaskQueue on Windows.
The requirements have been relaxed a little bit which should allow the test to pass on our VMs that run the tests.

BUG=6610

Review-Url: https://codereview.webrtc.org/2458713005
Cr-Commit-Position: refs/heads/master@{#14836}
2016-10-31 09:17:17 +00:00
tommi
45d18eb034 Re-enable the PostDelayed TaskQueue test on all platforms except Windows.
BUG=webrtc:6610

Review-Url: https://codereview.webrtc.org/2457763002
Cr-Commit-Position: refs/heads/master@{#14803}
2016-10-27 16:04:25 +00:00
terelius
91c2d43ced Disable TaskQueueTest.PostDelayed because of flakiness
BUG=webrtc:6610
NOTRY=True
TBR=tommi

Review-Url: https://codereview.webrtc.org/2456523002
Cr-Commit-Position: refs/heads/master@{#14790}
2016-10-26 16:04:35 +00:00
perkj
84bd5c73da Do not build task_queue.cc and include from webrtc_overrides in Chrome.
This is step 2 of the plan below.

The modified plan
1. First land unmodified task_queue.h into webrtc_override in Chrome
2. Modify build files in the webrtc repo to include the task_queue.h and task_queue.cc from webrtc_overrides. This will breaks webrtc Chrome FYI.
3. Combine a roll of webrtc to Chrome and  a the cl in https://codereview.chromium.org/2293913003/ into one  cl.
The combined cl will roll in build files from  2 and  add task_queue.cc in webrtc_overrides and build task_queue_unittest.cc as part of content_unittests to test task_queue.cc in webrtc_overrides.
4... Start using task queues in webrtc........

BUG=webrtc:5687

Review-Url: https://codereview.webrtc.org/2289203002
Cr-Commit-Position: refs/heads/master@{#13983}
2016-08-31 06:01:17 +00:00
tommi
c06b133b29 Reland of New task queueing primitive for async tasks: TaskQueue.
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.

TBR=perkj@webrtc.org,phoglund@webrtc.org

Review-Url: https://codereview.webrtc.org/1984503002
Cr-Commit-Position: refs/heads/master@{#12749}
2016-05-14 18:31:49 +00:00
tommi
3f90087ce8 Revert of New task queueing primitive for async tasks: TaskQueue. (patchset #8 id:330001 of https://codereview.webrtc.org/1927133004/ )
Reason for revert:
sigh.  Have to revert again as there seems to have have been some change made for pnacl and CrOS.

Original issue's description:
> Reland of New task queueing primitive for async tasks: TaskQueue. (patchset #1 id:1 of https://codereview.webrtc.org/1935483002/ )
>
> 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.
>
> TBR=perkj@webrtc.org
>
> Committed: https://crrev.com/65d1f2aba216d077c6d22488f03e56984aef1c68
> Cr-Commit-Position: refs/heads/master@{#12737}

TBR=perkj@webrtc.org,phoglund@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.webrtc.org/1981573002
Cr-Commit-Position: refs/heads/master@{#12738}
2016-05-13 21:33:39 +00:00
tommi
65d1f2aba2 Reland of New task queueing primitive for async tasks: TaskQueue. (patchset #1 id:1 of https://codereview.webrtc.org/1935483002/ )
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.

TBR=perkj@webrtc.org

Review-Url: https://codereview.webrtc.org/1927133004
Cr-Commit-Position: refs/heads/master@{#12737}
2016-05-13 20:05:05 +00:00
tommi
b296d0591c Revert of New task queueing primitive for async tasks: TaskQueue. (patchset #5 id:80001 of https://codereview.webrtc.org/1919733002/ )
Reason for revert:
Reverting this temporarily while I figure out the issues with the Chrome on android GN debug build.

Original issue's 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.

TBR=perkj@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.webrtc.org/1935483002
Cr-Commit-Position: refs/heads/master@{#12562}
2016-04-29 13:03:38 +00:00
tommi
0c9df5e568 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.

Review-Url: https://codereview.webrtc.org/1919733002
Cr-Commit-Position: refs/heads/master@{#12561}
2016-04-29 11:49:14 +00:00