摘要 |
Method of submitting data to shared queue by multiple producer threads, comprising: allocating 610 portion of queue memory for producer-thread output data by advancing an outer pointer to next available entry in queue; writing by producer-thread the output data to said portion; determining by producer-thread if the written portion was the only portion allocated and not written; advancing an inner pointer if the written portion is determined to be said only portion 640. A maximum value indicating a most advanced written entry in shared queue and a complete count indicating a total quantity of written thread output by multiple producers are also updated 620, 625. Inner pointer is advanced to maximum value if maximum value and complete count are equal 630. Wait-free mechanism by producer-threads advance inner pointer used to read valid data by consumer-thread. Wait-free and lock-free allocation and parallel writing of shared queue by multiple-producer threads is provided. |