Hi folks,
I’m creating a resource manager that will have many read clients. A lower level service passes data into the resource manager, which then passes it onto all clients. Clients will be using standard read/open/(maybe select as well).
I’ve got a basic RM up and running thanks to the docs on QNX’s website. However, the example there shows a RM that uses the attribute block to store a list of received data. A read then consumes from this list and removes the last entry and passes it to the client
I’m porting the app from a system that has a framework similar to resource managers, but each client is allocated a “mail box” when it opens the device, and all mailboxes receive a copy of the data from the lower level. Clients then call read and the framework pulls data out of the mailbox.
My current thinking is that I can do this in QNX by using an extended OCB structure that has a per-client list of data (Rather than one per-device) and then a “read” consumes the list for that client.
Another alternative is to implement a per-device list and manage it in such a way that it only discards items when they’ve been read by all clients, in effect keeping a per-device queue with the latest received always at the head and the rest being those that that haven’t been read by all clients. Naturally, there’ll be a size limit to a list.
Has anyone created a RM like this before and got any advice (Or am I missing the point of something here…)
Thanks…