Hi, I am trying to build a resource manager which interacts with the
clients with following manner.
clients can send commands to resourse manager asking it to read
data from ISA device. clients is then blocked
resource manager will then get bunch of data from the ISA device
but will not send the data to the client. Instead, it will write to
the shared memory and will acknowledge the client with the location
of the data in the shared memory.
client will be unblocked and will start reading from the shared
memory location that the resource manager has given to the client.
As you can see client doesn’t need to use the normal POSIX method to
communicate with the resource manager (ie read(), write(), etc…).
Then what is the best communication method to implement this in
resource manager?
What’s wrong with the Posix method? If you want to use shared memory you can
read the shared memory handle using the ‘Posix method’ i.e.
read(my_isa_fd, &shmem_ptr, sizeof(shmem_ptr));
Chapter “Leaving the client blocked, replying later” shows how to implement
the blocking on the resource manager side.
Hi, I am trying to build a resource manager which interacts with the
clients with following manner.
clients can send commands to resourse manager asking it to read
data from ISA device. clients is then blocked
resource manager will then get bunch of data from the ISA device
but will not send the data to the client. Instead, it will write to
the shared memory and will acknowledge the client with the location
of the data in the shared memory.
client will be unblocked and will start reading from the shared
memory location that the resource manager has given to the client.
As you can see client doesn’t need to use the normal POSIX method to
communicate with the resource manager (ie read(), write(), etc…).
Then what is the best communication method to implement this in
resource manager?
What’s wrong with the Posix method? If you want to use shared memory you can
read the shared memory handle using the ‘Posix method’ i.e.
read(my_isa_fd, &shmem_ptr, sizeof(shmem_ptr));
It’s kinda / sorta a kludge; you’re not really reading “consecutive data”
as the “read()” interface suggests. However, that said, “do whatever you
think you can get away with in a design review”
I’d go for a devctl() that sez “Acquire data, return index into shmem”
Cheers,
-RK
Chapter “Leaving the client blocked, replying later” shows how to implement
the blocking on the resource manager side.
clients can send commands to resourse manager asking it to read
data from ISA device. clients is then blocked
resource manager will then get bunch of data from the ISA device
but will not send the data to the client. Instead, it will write to
the shared memory and will acknowledge the client with the location
of the data in the shared memory.
client will be unblocked and will start reading from the shared
memory location that the resource manager has given to the client.
As you can see client doesn’t need to use the normal POSIX method to
communicate with the resource manager (ie read(), write(), etc…).
Then what is the best communication method to implement this in
resource manager?
Thanks
–
[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~museum/
Hi, I am trying to build a resource manager which interacts with the
clients with following manner.
clients can send commands to resourse manager asking it to read
data from ISA device. clients is then blocked
resource manager will then get bunch of data from the ISA device
but will not send the data to the client. Instead, it will write to
the shared memory and will acknowledge the client with the location
of the data in the shared memory.
Unless you have a very weak CPU and a very serious performance
problem, it’s best not to do it that way. Yes, you save one copy.
Is the added complexity and reduced reliability of shared memory
worth it?
We run video over FireWire through a resource manager that
returns the data via standard read/write, and one camera
uses about 5% of the (AMD 1GHz x86) CPU. Most ISA devices are
slower than FireWire.
thanks for all your suggestion.
And yes, I do think the performance is a issue with our design
because:
we are using ISA bus with upto 4-6 camera.
Our hardware can not use DMA and does not generate interrupt
Therefore, we need to poll for these data.
Yes, I know this is a pain… >
If you poll the data over the ISA bus you are more likey to get about
1Mbyte/sec of transfer rate. That’s insignificant compare to transfert rate
of QNX messaging. In a case like this using shared memory over messaging
will make very little difference.