Choosing the Simplest Tools for the Job

bug.gif

This morning I ran into a nasty little seg fault on my Greek Engine and it appeared to be related to the multiple-producer/single-consumer ring FIFO where it appeared to have gotten a "dead space" in the FIFO, and with that, the head could not advance and so the queue filled and blew up. Again, I say it appears this happened, but I can't be 100% certain. It happened on several boxes, so I'm not ruling out bad input data, as that would be a far more likely issue, but other (slower) boxes didn't have this issue, so it's hard to pin this down.

What I can say is that there's always more than one way to skin a cat, and in truth, the particular queue I was using was overkill for the task at hand. As point of fact, the code only needs a single-producer/single-consumer queue and that's far simpler than the multiple-producer/single-consumer queue. So, taking a cue from my own advice about design, simplifying the code was the right thing to do. So I simply swapped out the one for the other and away we go.

Good advice - use what's needed, not just what's cool or flashy.