[ECOS] Message boxes - good/bad practices

Pete Barrie peter@cis.strath.ac.uk
Thu Jul 18 04:02:00 GMT 2002


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



More information about the Ecos-discuss mailing list