This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Message boxes - good/bad practices


Message boxes in eCos allow the transmission
of simple (byte up to 32 bits) messages via the
buffered message queue.

Some other OS's deliver more sophisticated (with more overheads)
buffered message schemes where the messages can be any
(parameterised) size.

Obviously a pointer can be sent from one thread to another, for the receiver
to access larger data structures This is clearly not a robust route to data sharing.
On on asynchronous basis the buffer space may be clobbered before
the receiver accesses it.
However, the following scenario is probably more robust. What do people
think about the robustness of this one? It implements trivial
synchronous message passing:

Thread_Tx
----------------
malloc space for bufMessage
fill buffer <size_tag><bytes..........>
send message to thread_Rx with buffer ptr

----
----
wait for reply_message from thread_Rx
fill buffer <size_tag><bytes..........>
send message to thread_Rx with buffer ptr

etc


Thread_Rx
----------------

wait for message
access buf via pointer and size_tag
send reply_message


Pete


--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]