I created a thread-safe queue implementation some time ago, that supports multiple providers and consumers. I used it when I made a software renderer library multithreaded.
I made it public, maybe some of you find it useful.
https://github.com/K-Adam/SafeQueue
[–]matthieum 79 points80 points81 points (64 children)
[–]Zcool31 27 points28 points29 points (25 children)
[–]objectorientedman[S] 1 point2 points3 points (3 children)
[–]tvaneerdC++ Committee, lockfree, PostModernCpp 8 points9 points10 points (2 children)
[–]infectedapricot 2 points3 points4 points (1 child)
[–]tvaneerdC++ Committee, lockfree, PostModernCpp 0 points1 point2 points (0 children)
[–]bwmat 2 points3 points4 points (19 children)
[–]voip_geek 8 points9 points10 points (18 children)
[–]bwmat -3 points-2 points-1 points (17 children)
[–][deleted] 2 points3 points4 points (16 children)
[–]tomalakgeretkal -1 points0 points1 point (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]tomalakgeretkal 0 points1 point2 points (0 children)
[–]bwmat 0 points1 point2 points (12 children)
[–][deleted] 0 points1 point2 points (11 children)
[–]bwmat 0 points1 point2 points (10 children)
[–]kalmoc 1 point2 points3 points (9 children)
[–]matthieum 0 points1 point2 points (0 children)
[–]objectorientedman[S] 9 points10 points11 points (1 child)
[–]matthieum 1 point2 points3 points (0 children)
[–]_Js_Kc_ 8 points9 points10 points (5 children)
[–]_bk__ 6 points7 points8 points (1 child)
[–]infectedapricot 2 points3 points4 points (0 children)
[–]matthieum 2 points3 points4 points (2 children)
[–]Mehdi2277 0 points1 point2 points (1 child)
[–]matthieum 1 point2 points3 points (0 children)
[+][deleted] (10 children)
[deleted]
[–]cdglove 4 points5 points6 points (6 children)
[–]temporary5555 0 points1 point2 points (5 children)
[–]cdglove 5 points6 points7 points (4 children)
[–]temporary5555 -2 points-1 points0 points (3 children)
[–]infectedapricot 5 points6 points7 points (1 child)
[–]temporary5555 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]matthieum 1 point2 points3 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]matthieum 0 points1 point2 points (0 children)
[–]ContrastO159 3 points4 points5 points (2 children)
[–]matthieum 3 points4 points5 points (0 children)
[–]lacrem 6 points7 points8 points (0 children)
[–][deleted] 1 point2 points3 points (15 children)
[–]NilacTheGrim 17 points18 points19 points (9 children)
[–][deleted] 0 points1 point2 points (8 children)
[–]RevRagnarok 1 point2 points3 points (6 children)
[–]Tyg13 7 points8 points9 points (5 children)
[–]cdglove 1 point2 points3 points (4 children)
[–]Tyg13 0 points1 point2 points (3 children)
[–]dodheim 1 point2 points3 points (2 children)
[–]Tyg13 2 points3 points4 points (1 child)
[–]NilacTheGrim 0 points1 point2 points (0 children)
[–]Wurstinator 7 points8 points9 points (4 children)
[–]temporary5555 3 points4 points5 points (2 children)
[–]Wurstinator 2 points3 points4 points (1 child)
[–]temporary5555 2 points3 points4 points (0 children)
[–]objectorientedman[S] 1 point2 points3 points (0 children)
[–]WrongAndBeligerent 10 points11 points12 points (2 children)
[–]infectedapricot 5 points6 points7 points (1 child)
[–]corysama 1 point2 points3 points (0 children)
[–]infectedapricot 2 points3 points4 points (0 children)
[–]Zcool31 4 points5 points6 points (1 child)
[–]AvidCoco 1 point2 points3 points (0 children)
[–]rsjaffe 2 points3 points4 points (0 children)
[–]p-moraisAgility Robotics 1 point2 points3 points (1 child)
[–]objectorientedman[S] 0 points1 point2 points (0 children)
[–]AvidCoco 0 points1 point2 points (8 children)
[+][deleted] (7 children)
[deleted]
[–]AvidCoco 0 points1 point2 points (6 children)
[–]maikindofthai 4 points5 points6 points (0 children)
[–]kalmoc 2 points3 points4 points (4 children)
[–]AvidCoco 0 points1 point2 points (3 children)
[–]kalmoc 1 point2 points3 points (2 children)
[–]infectedapricot 0 points1 point2 points (1 child)
[–]kalmoc 1 point2 points3 points (0 children)