A little bit stuck

I seem to have a little bit of a mental block when it comes to writing the code to read and write from the database. I have started writing routines that use the message queue to read and write the tag values through the library from the modules. I am hesitant to write too much of the code because I'm afraid that I'll wind up redoing it all later. I think that in terms of reading and writing the data the message queue is the right idea over using shared memory. Shared memory is likely to be more efficient. Although to use shared memory I'll have to use semaphores to avoid the concurency issues, and this may make it no more efficient than the message queue.

One of the problems with using shared memory for reading and writing is dealing with the growth of the database. Each module would have to detach from the shared memory (and in the meantime stop what they are doing) and wait for the core to remove the old shared memory segment, grow the database and then create the new shared memory segment. This might not be that big of a deal but it sure seems complicated. When using message queues the database can grow and the modules need know nothing about it.

Another problem is that all of the permissions, locking and other interaction with the database will have to be controlled in the libdax library instead of in the core. This may not be a great problem but I suspect it will cause me some unforseen problems when this database finally gets shared accross the network. With a message queue any decisions about who gets to read and write to any particular point get's to be handled in the core process and is centralized. The message queue messages are also very close to looking like socket messages that can later be used for network communication. I guess for that matter I could forget the message queue and use sockets for the local IPC and then going to network would be easy as pie. The message queue is just so simple and there will be lots of modules each using the same queue to talk to the process.

Writing this kind of stuff down seems to help me think these things through. The more I think about it the more I am talking myself into using the message queue. Comments are always welcome.