Message Queue processing without a Mutex (C)
Posted on 2010-08-18
I'm trying to dream up a clever way to create a Message Queue processing system with multiple threads without the use of a mutex for maximum performance. Since I'm working in C, the Message Queue could be a linked pointer list. Multiple threads would be adding to the Message Queue (adding to the linked pointer list). Only one thread would be processing Messages and removing them from the queue in FIFO order.
Guess the problem I see is if an input and the processor thread both try to modify the first message in the list. Is there a good way to do this without a mutex or is a mutex the way to go?