Single Reader, Single Writer Fixed Sized Lookaside Dequeu

http://www.insomniacgames.com/tech/articles/0807/files/multithreading_optimization_basics.pdf


Rules for use:



  • Push() can only be called from one thread, but it doesn't need to be the same thread as Pop().

  • Pop() can only be called from one thread, but it doesn't need to be the same thread as Push().

  • max_count must be a power of two

  • Don't Pop() more than Count()

  • Check IsFull() or Count() before a Push()

0 komentarze:

Prześlij komentarz

 
Tomasz Kulig