Thread running at User-interactive quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class

Can anyone explain why I would be getting this warning ?

[Internal] Thread running at User-interactive quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class. Investigate ways to avoid priority inversions.

The code (NB: This method is called on the main thread)

- (void)parseAudioTracks:(NSArray<AVAssetTrack *> *)audioTracks
{
	NSMutableArray<AVAudioMixInputParameters *> *inputParameters = [NSMutableArray arrayWithCapacity:audioTracks.count];
	NSMutableArray *tracksNames = [NSMutableArray array];
	NSMutableArray *tracksChannels = [NSMutableArray array];
	NSUInteger lastChannel = 0;
	for ( NSUInteger i = 0 ; i < audioTracks.count; i++ )
	{
		AVAssetTrack *track = audioTracks[i];
		for ( AVMetadataItem *item in track.metadata ) <-- WARNING HERE
...```


Answered by DTS Engineer in 848051022

Hello,

Check out the discussion of thread priority inversions in Diagnosing performance issues early.

Could it be that there is audio processing occurring on the main thread that is waiting on the results of a lower priority thread? This would cause such a warning.

Hello,

Check out the discussion of thread priority inversions in Diagnosing performance issues early.

Could it be that there is audio processing occurring on the main thread that is waiting on the results of a lower priority thread? This would cause such a warning.

It looks like you're using the deprecated "metadata" property.

I'm not familiar with these AV APIs, but it looks like modern versions make the asynchronous nature of this operation explicit, as in this example.

Thread running at User-interactive quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class
 
 
Q