Data Sharing Architecture

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I am wondering if someone has any advice about how to share data among tasks
in an embedded system. I have several producers of data and several possible
consumer of the data. In some cases, one consumer may be consuming different
types of data. I am wondering what the best way to share this data with a
consumer task.
Issue # 1: Should I send different pieces of data through a single  message
queue owned by the consumer, or should there be separate queues for each
type of data? My OS requires that I cannot have variable length mesages in a
given queue.

Issue #2: Is it best to have single task that asks as a "router" for all of
this data. So, essentially, it would take incoming data from producers, and
distribute it to interested consumers. Or, is it better to have each
producer deliver their respective data to each consumer on their own?

Any thoughts would be appreciated!

Brad



Re: Data Sharing Architecture
On Wed, 17 Sep 2003 16:59:51 -0500, "Bradford Cox"

Quoted text here. Click to load it

It's hard to say for sure without more information about your OS.  If
all the tasks in your OS live in a common address space, you can pass
pointers to blocks of memory containing the data through queues.  All
queues contain the same size and type of data, namely a pointer.

It your tasks reside in separate address spaces, it becomes more
complex.  Some operating systems provide special support for this (a
system call copies the data from the sending task address space to the
receiving address space), or you might have to allocate a queue of
objects large enough to hold the largest data item a particular task
will receive.

If you provide more detail on your OS and its message queue features.

--
Jack Klein
Home: http://JK-Technology.Com
We've slightly trimmed the long signature. Click to see the full one.
Re: Data Sharing Architecture
Quoted text here. Click to load it


Depending on the application and context, there may be several possible
solutions. It is the job of the designer, in this case you, to weigh them
against each other. It may even be helpful to program all of them to
do some research on their advantages and disadvantages.
BTW, writing a command queue for variable sized commands is not that hard.
Give it a try as warm-up exercise.

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com
& commercial newsgroups - http://www.talkto.net


Site Timeline