You are describing 'Interprocess Communications' (IPC) in general, and probably message queues/mailboxes more specifically. In Linux, there are at least two existing standard implementations of these: POSIX, and System V. Both provide APIs for efficient and reliable IPC, and are widely documented.
System V IPC
POSIX IPC
There are other APIs and schemes that provide similar functionality. I don't think it makes sense to attempt to create your implementations of these systems, but rather to build your application(s) around the existing systems. For a very useful primer on the subject generally, I recommend
Beej's Guide to Unix Interprocess Communication
--- rod.