Suggestion for locking before mComputeQueue->submit()#453
Open
troelsy wants to merge 1 commit intoKomputeProject:masterfrom
Open
Suggestion for locking before mComputeQueue->submit()#453troelsy wants to merge 1 commit intoKomputeProject:masterfrom
troelsy wants to merge 1 commit intoKomputeProject:masterfrom
Conversation
Signed-off-by: Troels Ynddal <troels@ynddal.dk>
Member
|
Thanks! Just had a quick read - few qs: Why do we need to add these as a std::function as part of the lock? ie instaed of just implementing a lock Also - is this something that needs to go as part of the Sequence? i.e. vs having this as a separately managed lock at the application layer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I mentioned briefly in #452 that GStreamer has to lock and unlock a mutex before calling
this->mComputeQueue->submit. I thought I would do a separate PR, so we had something concrete to discuss. This is a draft of how I imagine the interface could look like.I have a feeling that others might need this as
vkQueueSubmitis not thread safe. In our use case, we have lots of threads and GStreamer gives us the lock that all GStreamer elements share. In this PR, the locks are no-op functions if nothing is given to thekp::Managerconstructor, but we could also create a mutex insidekp::Manager.I have suggested that we create a struct to hold the locks, but they could also be separate arguments. I'm not checking if both are set or unset, but it could also be added to the constructor.
This is how we initialize the locking struct
where
gst_queueis a pointer to GstVulkanQueue