Skip to content

Conversation

@rromanchuk
Copy link
Collaborator

This is a bit ugly, but PoC test to resolve priority inversion warnings

Thread Performance Checker: Thread running at QOS_CLASS_USER_INITIATED waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions
PID: 22258, TID: 26715793

This is probably more relevant in an async/await context.

Example reproduction where callee uses qos of .userInitiated

Task(priority: .userInitiated) {
   try? await model.process()
}
    @MainActor
    class ViewModel: ObservableObject {
        @Published var proccessedVideo: URL?
        init() {}
        
       func process() async throws {
            let nl = NextLevelSessionExporter(withAsset: mixComposition)
            // nl.videoComposition = videoComposition
            // nl.videoOutputConfiguration = self.videoSettings
            // nl.audioOutputConfiguration = self.audioSettings
            // nl.outputURL = watermarkedFilepath
            
            
            try await withCheckedThrowingContinuation { continuation in
                nl.export(completionHandler:  { result in
                    switch result {
                    case .success:
                        continuation.resume()
                    case let .failure(error):
                        continuation.resume(throwing: error)
                    }
                })
            }
            
            self.proccessedVideo = watermarkedFilepath       

       }
    }

Confirmed warnings went away with let nl = NextLevelSessionExporter(withAsset: mixComposition, qos: .userInitiated),

@piemonte
Copy link
Contributor

thanks for this contribution! it has been integrated (with enhancements) and your PR is referenced in the README too.

@piemonte piemonte closed this Jan 13, 2026
piemonte added a commit that referenced this pull request Jan 13, 2026
  - Integrate QoS configuration from PR #44 (rromanchuk)
  - Integrate black frames fix from PR #39 (Developer-Ecosystem-Engineering)

  Fixes #56, #48, #41, #55, #39
  Closes #44, #39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants