Closed
Bug 821062
Opened 10 years ago
Closed 8 years ago
Share a decoding thread pool for all AudioContexts
Categories
(Core :: Web Audio, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 1108701
mozilla30
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
Details
Attachments
(1 file)
3.85 KB,
patch
|
padenot
:
review+
|
Details | Diff | Splinter Review |
Right now we use a decoding thread pool per AudioContext. We should use a global one.
Comment 1•9 years ago
|
||
I have added content/media/SharedThreadPool.h which is adds the ability for threadsafe singleton shared thread pools to be acquired by a nsCString name, so they can be easily shared and disposed of with minimal fuss. I recommend you use them, rather than rolling your own again.
Assignee | ||
Comment 2•9 years ago
|
||
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → ehsan
Component: Video/Audio → Web Audio
Assignee | ||
Updated•9 years ago
|
Attachment #8378675 -
Flags: review?(paul)
Comment 3•9 years ago
|
||
Comment on attachment 8378675 [details] [diff] [review] Share a decoding thread pool for all AudioContexts; r=padenot Review of attachment 8378675 [details] [diff] [review]: ----------------------------------------------------------------- Can you change the "MOZ_ASSERT(!mThreadPool == NS_IsMainThread()," assertions in MediaDecodeTask::Decode() to a !NS_IsMainThread() assertion? The fact that this code still implies that it could run on the main thread worries me.
Comment 4•9 years ago
|
||
Comment on attachment 8378675 [details] [diff] [review] Share a decoding thread pool for all AudioContexts; r=padenot Review of attachment 8378675 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/media/webaudio/MediaBufferDecoder.h @@ +91,5 @@ > private: > bool EnsureThreadPoolInitialized(); > > private: > + RefPtr<SharedThreadPool> mThreadPool; Hm, didn't khuey recently said we should not use RefPtr ? [1] Can we just change that to an nsRefPtr instead? [1]: http://logbot.glob.com.au/?c=mozilla%23media&s=18+Feb+2014&e=18+Feb+2014&h=MOZ_COUNT_CTOR#c48666
Attachment #8378675 -
Flags: review?(paul) → review+
Comment 5•9 years ago
|
||
(In reply to Chris Pearce (:cpearce) from comment #3) > Comment on attachment 8378675 [details] [diff] [review] > Share a decoding thread pool for all AudioContexts; r=padenot > > Review of attachment 8378675 [details] [diff] [review]: > ----------------------------------------------------------------- > > Can you change the "MOZ_ASSERT(!mThreadPool == NS_IsMainThread()," > assertions in MediaDecodeTask::Decode() to a !NS_IsMainThread() assertion? > The fact that this code still implies that it could run on the main thread > worries me. This can only happen if one fiddles with a pref that is not even in the default list of pref. It might even not work anymore, but I seem to recall ehsan had a good reason to no remove this code.
Assignee | ||
Comment 6•9 years ago
|
||
(In reply to Paul Adenot (:padenot) from comment #5) > (In reply to Chris Pearce (:cpearce) from comment #3) > > Comment on attachment 8378675 [details] [diff] [review] > > Share a decoding thread pool for all AudioContexts; r=padenot > > > > Review of attachment 8378675 [details] [diff] [review]: > > ----------------------------------------------------------------- > > > > Can you change the "MOZ_ASSERT(!mThreadPool == NS_IsMainThread()," > > assertions in MediaDecodeTask::Decode() to a !NS_IsMainThread() assertion? > > The fact that this code still implies that it could run on the main thread > > worries me. > > This can only happen if one fiddles with a pref that is not even in the > default list of pref. It might even not work anymore, but I seem to recall > ehsan had a good reason to no remove this code. I think we should remove it when Blink ships the unprefixed AudioContext implementation and remove their webkitAudioContext implementation, which is going to happen soon. (In reply to Paul Adenot (:padenot) from comment #4) > Comment on attachment 8378675 [details] [diff] [review] > Share a decoding thread pool for all AudioContexts; r=padenot > > Review of attachment 8378675 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: content/media/webaudio/MediaBufferDecoder.h > @@ +91,5 @@ > > private: > > bool EnsureThreadPoolInitialized(); > > > > private: > > + RefPtr<SharedThreadPool> mThreadPool; > > Hm, didn't khuey recently said we should not use RefPtr ? [1] Can we just > change that to an nsRefPtr instead? > > [1]: > http://logbot.glob.com.au/ > ?c=mozilla%23media&s=18+Feb+2014&e=18+Feb+2014&h=MOZ_COUNT_CTOR#c48666 This code forces you to use RefPtr (because of the TemporaryRef return value) but I'm fixing that mess in bug 935778. One more usage won't hurt that much.
Assignee | ||
Comment 7•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/169de60f0b1e
Comment 8•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/169de60f0b1e
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Comment 9•9 years ago
|
||
Try run for backout https://tbpl.mozilla.org/?tree=Try&rev=c170ac4f53bf https://tbpl.mozilla.org/?tree=Try&rev=f6e6a9649ea1
Comment 10•9 years ago
|
||
Backed out for shutdown hang reported in bug 1026325. https://hg.mozilla.org/integration/mozilla-inbound/rev/109ded3295f8
Comment 11•8 years ago
|
||
Fixed in bug 1108701.
Status: REOPENED → RESOLVED
Closed: 9 years ago → 8 years ago
No longer depends on: 1108701
Resolution: --- → DUPLICATE
Comment 12•5 years ago
|
||
Removing leave-open keyword from resolved bugs, per :sylvestre.
Keywords: leave-open
You need to log in
before you can comment on or make changes to this bug.
Description
•