Multithread Resource Manager

I make a multithread resource manager, but the operations (read, write)
run in secuentialy manner for N clients. I need independent run operations.
Any example please.

Thanks.
Leandro.

Leandro Medina <lmedina@vai-ingdesi.com> wrote:

I make a multithread resource manager, but the operations (read, write)
run in secuentialy manner for N clients. I need independent run operations.
Any example please.

It is a POSIX requirement that read and write operations be atomic with
respect to one another. Also, by locking the attribute during the IO
callouts you can safely update the data structure (times, flags, etc)
which could otherwise be problematic on a RISC or SMP machine. And
often concurrent operations make no sense (although they sometimes do).
Your N clients can perform operations on N different files at the same
time, but will serialise on the same file for the reasons above. It
is possible to manipulate the iofunc_attr_t locks yourself to change
this, but what exactly are you trying to achieve … what is your
resource manager controlling … ?

Is a device manager and this comunicacte the PC whit extern devices, with
many TCP connections. I use iofunc_attr_unlock() y io_read() and io_write()
functions. Is correct this?
Thanks.


“John Garvey” <jgarvey@qnx.com> wrote in message
news:bfpg6n$ln9$1@nntp.qnx.com

Leandro Medina <> lmedina@vai-ingdesi.com> > wrote:
I make a multithread resource manager, but the operations (read, write)
run in secuentialy manner for N clients. I need independent run
operations.
Any example please.

It is a POSIX requirement that read and write operations be atomic with
respect to one another. Also, by locking the attribute during the IO
callouts you can safely update the data structure (times, flags, etc)
which could otherwise be problematic on a RISC or SMP machine. And
often concurrent operations make no sense (although they sometimes do).
Your N clients can perform operations on N different files at the same
time, but will serialise on the same file for the reasons above. It
is possible to manipulate the iofunc_attr_t locks yourself to change
this, but what exactly are you trying to achieve … what is your
resource manager controlling … ?

Leandro Medina <lmedina@vai-ingdesi.com> wrote:

Is a device manager and this comunicacte the PC whit extern devices, with
many TCP connections. I use iofunc_attr_unlock() y io_read() and io_write()
functions. Is correct this?

It may be correct – but it could be very ugly. Especially if updates
to the attribute function overlap.

If you handle multiple external devices, might it make more sense to
register different names for each device, and then have multiple attribute
structures, etc?

-David

Thanks.



“John Garvey” <> jgarvey@qnx.com> > wrote in message
news:bfpg6n$ln9$> 1@nntp.qnx.com> …
Leandro Medina <> lmedina@vai-ingdesi.com> > wrote:
I make a multithread resource manager, but the operations (read, write)
run in secuentialy manner for N clients. I need independent run
operations.
Any example please.

It is a POSIX requirement that read and write operations be atomic with
respect to one another. Also, by locking the attribute during the IO
callouts you can safely update the data structure (times, flags, etc)
which could otherwise be problematic on a RISC or SMP machine. And
often concurrent operations make no sense (although they sometimes do).
Your N clients can perform operations on N different files at the same
time, but will serialise on the same file for the reasons above. It
is possible to manipulate the iofunc_attr_t locks yourself to change
this, but what exactly are you trying to achieve … what is your
resource manager controlling … ?


QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.