look, i'm tellin' ya, dood, everything you're trying to do is in Beej.
if only you'd bother to read it, you'd see for yourself, there's an entire chapter on message queues.
.there's no point in me trying to explain this to you at this point, because i haven't found a single introductory text that explains it better than Beej. i would just essentially be repeating everything he says. since he's already said it, why should i copy him.
just read the chapter already.