producer up code calling other code

bridged with qdn.public.ddk.network
Post Reply
Jay Witherspoon

producer up code calling other code

Post by Jay Witherspoon » Wed Nov 20, 2002 3:30 pm

If I load a network driver with mount -T io-net, and then later load a piece
of code that will need to exchange some packets with this driver (which is
not being using until the second piece of code is executed), can the two
programs call routines within each other? The non-driver code is already
written and is expecting to call a routine to get a packet and passes the
address of its receive routine for the driver to call when it receives a
packet. Is this possible? If not, is message queues the best way to xfer
between the driver and the non-driver code?

Sean Boudreau

Re: producer up code calling other code

Post by Sean Boudreau » Wed Nov 20, 2002 5:38 pm

Jay Witherspoon <spoon@scubadiving.com> wrote:
If I load a network driver with mount -T io-net, and then later load a piece
of code that will need to exchange some packets with this driver (which is
not being using until the second piece of code is executed), can the two
programs call routines within each other? The non-driver code is already
written and is expecting to call a routine to get a packet and passes the
address of its receive routine for the driver to call when it receives a
packet. Is this possible? If not, is message queues the best way to xfer
between the driver and the non-driver code?
If they are in the same process (io-net here) you can do this, otherwise
to need some form of IPC.

-seanb

Jay Witherspoon

Re: producer up code calling other code

Post by Jay Witherspoon » Thu Nov 21, 2002 5:48 pm

Is there a significant performance penalty with POSIX queues (mq_xxx) and
QNX raw messaging (MsgXXX)?

"Sean Boudreau" <seanb@node25.ott.qnx.com> wrote in message
news:arghbj$1h8$1@nntp.qnx.com...
Jay Witherspoon <spoon@scubadiving.com> wrote:
If I load a network driver with mount -T io-net, and then later load a
piece
of code that will need to exchange some packets with this driver (which
is
not being using until the second piece of code is executed), can the two
programs call routines within each other? The non-driver code is
already
written and is expecting to call a routine to get a packet and passes
the
address of its receive routine for the driver to call when it receives a
packet. Is this possible? If not, is message queues the best way to
xfer
between the driver and the non-driver code?

If they are in the same process (io-net here) you can do this, otherwise
to need some form of IPC.

-seanb

Jay Witherspoon

Re: producer up code calling other code

Post by Jay Witherspoon » Thu Nov 21, 2002 6:07 pm

should say vs, not and...
Is there a significant performance penalty with POSIX queues (mq_xxx) vs
QNX raw messaging (MsgXXX)?

"Jay Witherspoon" <spoon@scubadiving.com> wrote in message
news:arj5tp$ki3$1@inn.qnx.com...
Is there a significant performance penalty with POSIX queues (mq_xxx) and
QNX raw messaging (MsgXXX)?

"Sean Boudreau" <seanb@node25.ott.qnx.com> wrote in message
news:arghbj$1h8$1@nntp.qnx.com...
Jay Witherspoon <spoon@scubadiving.com> wrote:
If I load a network driver with mount -T io-net, and then later load a
piece
of code that will need to exchange some packets with this driver
(which
is
not being using until the second piece of code is executed), can the
two
programs call routines within each other? The non-driver code is
already
written and is expecting to call a routine to get a packet and passes
the
address of its receive routine for the driver to call when it receives
a
packet. Is this possible? If not, is message queues the best way to
xfer
between the driver and the non-driver code?

If they are in the same process (io-net here) you can do this, otherwise
to need some form of IPC.

-seanb



Xiaodan Tang

Re: producer up code calling other code

Post by Xiaodan Tang » Thu Nov 21, 2002 6:56 pm

MsgXXX directly pass the data (one copy), where mq_XXX pass the data
twice (two copy).

-xtang
Jay Witherspoon <spoon@scubadiving.com> wrote in message
news:arj719$m0k$1@inn.qnx.com...
should say vs, not and...
Is there a significant performance penalty with POSIX queues (mq_xxx) vs
QNX raw messaging (MsgXXX)?

"Jay Witherspoon" <spoon@scubadiving.com> wrote in message
news:arj5tp$ki3$1@inn.qnx.com...
Is there a significant performance penalty with POSIX queues (mq_xxx)
and
QNX raw messaging (MsgXXX)?

"Sean Boudreau" <seanb@node25.ott.qnx.com> wrote in message
news:arghbj$1h8$1@nntp.qnx.com...
Jay Witherspoon <spoon@scubadiving.com> wrote:
If I load a network driver with mount -T io-net, and then later load
a
piece
of code that will need to exchange some packets with this driver
(which
is
not being using until the second piece of code is executed), can the
two
programs call routines within each other? The non-driver code is
already
written and is expecting to call a routine to get a packet and
passes
the
address of its receive routine for the driver to call when it
receives
a
packet. Is this possible? If not, is message queues the best way
to
xfer
between the driver and the non-driver code?

If they are in the same process (io-net here) you can do this,
otherwise
to need some form of IPC.

-seanb





David Gibbs

Re: producer up code calling other code

Post by David Gibbs » Thu Nov 21, 2002 7:18 pm

Jay Witherspoon <spoon@scubadiving.com> wrote:
Is there a significant performance penalty with POSIX queues (mq_xxx) and
QNX raw messaging (MsgXXX)?
Yes.

mq_send is a S/R/R with mqueue process.
mq_recv is a S/R/R with mqueue process.

So mq_send to mq_recv is 2 S/R/R, at least twice as many context switches,
plus queueing/dequeueing overhead in mqueue.

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

Post Reply

Return to “qdn.public.ddk.network”