Closed
Bug 821062
Opened 12 years ago
Closed 10 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•11 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•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → ehsan
Component: Video/Audio → Web Audio
Assignee | ||
Updated•11 years ago
|
Attachment #8378675 -
Flags: review?(paul)
Comment 3•11 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•11 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•11 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•11 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•11 years ago
|
||
Comment 8•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Comment 9•10 years ago
|
||
Comment 10•10 years ago
|
||
Backed out for shutdown hang reported in bug 1026325.
https://hg.mozilla.org/integration/mozilla-inbound/rev/109ded3295f8
Comment 11•10 years ago
|
||
Fixed in bug 1108701.
Status: REOPENED → RESOLVED
Closed: 11 years ago → 10 years ago
No longer depends on: 1108701
Resolution: --- → DUPLICATE
Comment 12•7 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
•