resource manager design issue?

Hi, I am trying to build a resource manager which interacts with the
clients with following manner.

  1. clients can send commands to resourse manager asking it to read
    data from ISA device. clients is then blocked
  2. 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.
  3. 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

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.

“jinma” <matthew.jin@fmcti-dot-com.no-spam.invalid> schrieb im Newsbeitrag
news:d0ledc$ct2$1@inn.qnx.com

Hi, I am trying to build a resource manager which interacts with the
clients with following manner.

  1. clients can send commands to resourse manager asking it to read
    data from ISA device. clients is then blocked
  2. 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.
  3. 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

Martin Nylund <mnylund@emtrion.de> wrote:

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” :slight_smile:

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.

“jinma” <> matthew.jin@fmcti-dot-com.no-spam.invalid> > schrieb im Newsbeitrag
news:d0ledc$ct2$> 1@inn.qnx.com> …
Hi, I am trying to build a resource manager which interacts with the
clients with following manner.

  1. clients can send commands to resourse manager asking it to read
    data from ISA device. clients is then blocked
  2. 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.
  3. 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.

  1. clients can send commands to resourse manager asking it to read
    data from ISA device. clients is then blocked
  2. 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.

John Nagle

thanks for all your suggestion.
And yes, I do think the performance is a issue with our design
because:

  1. we are using ISA bus with upto 4-6 camera.
  2. Our hardware can not use DMA and does not generate interrupt
  3. Therefore, we need to poll for these data.
    Yes, I know this is a pain… :frowning:

“jinma” <matthew.jin@fmcti-dot-com.no-spam.invalid> wrote in message
news:d151k7$6sb$1@inn.qnx.com

thanks for all your suggestion.
And yes, I do think the performance is a issue with our design
because:

  1. we are using ISA bus with upto 4-6 camera.
  2. Our hardware can not use DMA and does not generate interrupt
  3. Therefore, we need to poll for these data.
    Yes, I know this is a pain… > :frowning:

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.