3DSoftware.com > ECE > MPSoC > Messaging
Messaging
 
This series of articles covers MPSoC technologies and general computing.
 
Previous Page:
Threads
 
C++ Classes
 
You can develop and test C++ classes across threads with messaging, similar to how the OSI networking paradigm works.
 
The Open Systems Interconnection (OSI) model is a stack of seven layers:
 
Application
Presentation
Session
Transport
Network
Data link
Physical
 
Each network node implements the layers, and sends messages to other nodes only through the bottom layer, which is the physical layer, where “mechanical, electrical, and procedural interfaces for different physical transmission media are specified.” [ 1 ]
 
The next layer up from the physical layer is the data link layer which corrects errors in the physical layer (resending packets if nded).
 
“The data link layer abstracts the physical layer as an unreliable digital link, where the probability of bit upsets is non-null.” [ 2 ]
 
Moving upward, each layer is an abstraction of the layer beneath it. When a layer sends a message to the same layer in a different node, the message first works its way down through all the layers in the sending node to the physical layer. The physical layer then sends the message to the physical layer in the other node, from where the message works its way up to the receiving layer.
 
So the transmission of a message from one node to another is a U-shaped path, from an OSI layer to the bottom layer, then across to the other node, and then back up to the layer at the level the message was sent from.
Footnotes:
 
1.   Yingxu Wang, “Operating Systems,” in Richard C. Dorf (Editor), The Engineering Handbook 2nd Ed. (CRC, 2005), p. 144:9.
 
2.   Benini & De Micheli, “Networks on Chips,” in Jerraya & Wolf (Eds.), Multiprocessor Systems-on-Chips, p. 63.
 

 
Consider implementing a complex class structure across two threads. You can create two separate base classes, one for each thread. The two classes can send messages to each other asynchronously. Each base class has virtual functions for handling messages.
 
After developing and testing the two base classes, you can develop derived classes in each thread. Gradually you can add message handlers to the derived classes, overriding message handlers in the base classes.
 
After developing the derived classes, and they successfully communicate with each other (by receiving messages through their base classes), you can develop derived classes of the derived classes, and again gradually override message handlers until you get the next layer of derived classes working.
 
You can continue doing that for many layers of derived classes, reducing the complexity of design and introducing safety features as you go along (for possible removal of classes later if necessary).
 
 
Next Page:
2008 Addendum
 
 
Copyright © 2008 by 3D Software. All rights reserved.
3D Software, P.O. Box 221190, Sacramento CA 95822 USA
www.3DSoftware.com     Contact us
Tuesday, 06-Jan-2009 04:22:51 GMT