Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - message passing concept: (4 Items)
   
message passing concept  
I have a coceptual problem with message passing basics in QNX neutrino.  I am novice in RTOS and QNX .

 First:
 Does each thread own single channel for receiving? If not owned by each thread, is it owned by the process ? If it 
owned by process, does it mean every process will have a channel to receive message and any other process can send 
message to any other process channel by attaching to it?


Second:
Since any number of message send/receive  can be sent simultaneously, how does receiving thread make sure that the sent 
message is intended for it ?
Re: message passing concept  

samir kumar wrote:
> I have a coceptual problem with message passing basics in QNX neutrino.  I
am novice in RTOS and QNX .
> 
>  First:
>  Does each thread own single channel for receiving? If not owned by each
thread, is it owned by the process ? If it owned by process, does it mean
every process will have a channel to receive message and any other process
can send message to any other process channel by attaching to it?

A channel is owned by the process.  Any number of threads may call
MsgReceive on it.  An incoming message will be assigned to the first thread
in the receive queue.

> Second:
> Since any number of message send/receive  can be sent simultaneously, how
does receiving thread make sure that the sent message is intended for it ?

Normally threads share a channel (eg a pool of worker threads).  However a
thread can create it's own
channel via the ChannelCreate() kernel call if it needs to.  Of course the
sender must be aware of this
channel and create a connection to it.

-- 
cburgess@qnx.com
Associations:
post8388:
              Re: message passing concept -  - samir kumar
            
Re: message passing concept  
thank you....Colin Burgess

Do u mean to say, if i have 5 processes then i should have 5 channels if in case each wish to receive message on it.?

Or once created it can become single channel for all our processes for communication simultaneously?
Associations:
post8386:
              Re: message passing concept -  - samir kumar
            
Re: message passing concept  
> thank you....Colin Burgess
> 
> Do u mean to say, if i have 5 processes then i should have 5 channels if in 
> case each wish to receive message on it.?
> 
> Or once created it can become single channel for all our processes for 
> communication simultaneously?


perhaps it helps if you read this:
http://www.qnx.com/developers/docs/6.3.2/neutrino/sys_arch/intro.html#IPC

and then as a starting point try the sample code very below in this link here:
http://www.qnx.com/developers/docs/6.3.2/neutrino/lib_ref/n/name_attach.html

Jeevan