Closed Bug 956611 Opened 10 years ago Closed 10 years ago

Remove costly atomic reference counting in ProduceDataForStreamsBlockByBlock()

Categories

(Core :: Web Audio, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: karlt, Assigned: karlt)

References

Details

(Keywords: perf)

Attachments

(1 file)

MediaStream reference counting in ProduceDataForStreamsBlockByBlock() is
showing up as at least 2%, maybe as much as 3%, of MSG thread CPU usage in JProf profiles while in Jam mode on http://www.cappel-nord.de/webaudio/acid-defender/

(In reply to :Ehsan Akhgari (needinfo? me!) from bug 864709 comment #20)
> So one threading race condition that I can see here is that when we call
> MediaStreamGraphImpl::ProduceDataForStreamsBlockByBlock, we do not hold a
> strong reference to the media stream, so we have no guarantee for the stream
> (and therefore the engine) to not die when we're in a call to
> ProduceAudioBlock, if the cycle collector frees the node object on the main
> thread.

mStreams holds a strong reference.

Elements are only added or removed from mStreams in response to control
messages from the main thread or during UpdateStreamOrder().
Neither of these events will happen during ProduceDataForStreamsBlockByBlock().
Attachment #8355938 - Flags: review?(paul)
Attachment #8355938 - Flags: review?(paul) → review+
https://hg.mozilla.org/mozilla-central/rev/3749f33287c4
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: