Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - using poll/select with mq (alternative implementation): (4 Items)
   
using poll/select with mq (alternative implementation)  
I am working on a port of D-Bus (http://dbus.freedesktop.org/) to QNX.  Much of the API and related bindings poll on 
file descriptors.  

It seems that D-Bus' offering of using unix domain sockets as the transport ends up with a performance bottleneck going 
through io-net.

One solution proposed (and we want to minimize changes to D-Bus), is to use the mq_ API with the mq (not mqueue) server.


What is the best way to provide a pollable-fd while using the alternative message queue (mq) implementation?  The docs 
give these limitations:

(http://www.qnx.co.jp/developers/docs/6.4.0/neutrino/technotes/managing_mq_mqueue.html)
-In the alternate implementation, there's no direct counterpart to select() when used on a mixed set of queues and file 
descriptors or for the transition from a full queue, although you can use mq_notify() to register an event against a 
message queue on transition from empty. 

Thanks,
Andy
Re: using poll/select with mq (alternative implementation)  
> 
> It seems that D-Bus' offering of using unix domain sockets as the transport ends up with a performance bottleneck 
going through io-net.

What's the bottleneck?  Is a test case available?

-seanb
Re: using poll/select with mq (alternative implementation)  
Hi Sean,

Here's the test case:

1) start server
2) start daemon
3) run client with multiple parameters:
   size of message (len), # of messages to send (n)

Data is sent as follows:
repeat n times:
 client sends len bytes to daemon
 daemon sends len bytes to server
 server replies to daemon with same len bytes
 daemon replies to client with same len bytes
 client compares the contents of the message sent with what came back
-end repeat

client<->daemon and daemon<->server communication can be either 1) unix domain sockets; 2) via mqueue resource manager; 
3) QNX native message passing

To run the test, you can build the programs dclient, ddaemon, dserver (native message passing), mclient, mdaemon, 
mserver (using mqueue), and UnixDomainSockets\*, then run autoTransportCompare to get the time it takes for each using 
various message lengths. 

Times are output to d.results (for unix domain sockets)
m.results (for mqueue)
and q.results (for QNX native message passing)

Can the unix domain sockets become as fast as the traditional mqueue transport?  
How can we get faster throughput than io-pkt for local domain sockets without giving up pollable fd's and having to go 
with native IPC?

Also attached in the .zip is transport-benchmarks-v2.xls which has the times from my execution of the test case 
(probably less work for you to refer to this spreadsheet alonsgide looking at the .c files, rather than have to compile 
and run it all yourself).

Attachment: Excel transport-benchmarks-v2.xls 46.5 KB
Re: using poll/select with mq (alternative implementation)  
My apologies, the last posting should have included this attachment that has the source files to build the benchmark 
applications.
Attachment: Compressed file transportCompare.zip 61.48 KB