Skip to content
Snippets Groups Projects
  1. May 30, 2023
  2. May 29, 2023
  3. May 18, 2023
    • Sebastian Dröge's avatar
      Implement Orc function lazy initialization correctly via atomic operations · 8a86d517
      Sebastian Dröge authored
      By simply reading the initialized flag with a normal read operation, the
      compiler is allowed to optimize code in a way that assumes this value to
      never ever change from another thread. As such, the second read after
      the mutex is taken is allowed to be optimized away and on concurrent
      initialization the code would be compiled by Orc twice.
      
      Similarly, if the initialized flag was set it would not be guaranteed
      that this thread would also see the (non-atomic) write to the code pointer
      yet because both threads were accessing the same variable with an atomic
      operation.
      
      By always accessing the initialized flag with atomic operations, both
      problems should be avoided now at minimal cost, especially if a C11
      compatible compiler is used.
      
      Part-of: <gstreamer/orc!98>
      8a86d517
  4. May 06, 2023
  5. Apr 24, 2023
  6. Apr 13, 2023
  7. Apr 12, 2023
Loading