Open kvark opened 6 years ago
In light of #1976, we need to go through all the unsafe impl Send+Sync entries and verify if they make sense. In general, ObjC doesn't guarantee thread safety, and Apple documentation is explicit about which Cocoa objects can be used from multiple threads: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html
unsafe impl Send+Sync
As for Metal, the only documented thread-safe object appears to be MTLCommandQueue (so far). This is different from Vulkan, where VkDevice can be shared concurrently to create resources from multiple threads.
MTLCommandQueue
VkDevice
To follow Vulkan API all unsafe impl Send + Sync must stay. But implementations must be synchronized manually where needed.
unsafe impl Send + Sync
In light of #1976, we need to go through all the
unsafe impl Send+Sync
entries and verify if they make sense. In general, ObjC doesn't guarantee thread safety, and Apple documentation is explicit about which Cocoa objects can be used from multiple threads: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.htmlAs for Metal, the only documented thread-safe object appears to be
MTLCommandQueue
(so far). This is different from Vulkan, whereVkDevice
can be shared concurrently to create resources from multiple threads.