title: Vulkan Queue Synchronization in Multithreading
body: <p>In my application it is imperative that "state" and "graphics" are processed in separate threads. So for example, the "state" thread is only concerned with updating object positions, and the "graphics" thread is only concerned with graphically outputting the current state.</p>
  
  <p>For simplicity, let's say that the entirety of the state data is contained within a single <code>VkBuffer</code>. The "state" thread creates a <code>Compute Pipeline</code> with a <code>Storage Buffer</code> backed by the <code>VkBuffer</code>, and periodically <code>vkCmdDispatch</code>s to update the <code>VkBuffer</code>.</p>
  
  <p>Concurrently, the "graphics" thread creates a <code>Graphics Pipeline</code> with a <code>Uniform Buffer</code> backed by the same <code>VkBuffer</code>, and periodically draws/<code>vkQueuePresentKHR</code>s.</p>
  
  <p>Obviously there must be some sort of synchronization mechanism to prevent the "graphics" thread from reading from the <code>VkBuffer</code> whilst the "state" thread is writing to it.</p>
  
  <p>The only idea I have is to employ the usage of a host mutex from<code>vkQueueSubmit</code> to <code>vkWaitForFences</code> in both threads.</p>
  
  <p>I want to know, is there perhaps some other method that is more efficient or is this considered to be OK?</p>