[En-Nut-Discussion] reliability of message queues

Harald Kipp harald.kipp at egnite.de
Wed Feb 23 12:57:31 CET 2005


Ole,

At 12:43 23.02.2005 +0100, you wrote:

>I just thought to do so. Perhaps I'd better write something like a
>NutEventWaitMultiple(array of event queues).
>
>I'd like to have something like this:
>
>Start thread
>do something
>wait until connect event or error event (e.g. close down)
>while not error {
>   wait until data availabe event or error event
>   do something
>}
>
>Any idea how to implement this? My first thought was to write the above
>mentioned function. Message queues would do the job too but with a lot
>of overhead.

Another possibility is to use two thread, each
waiting on the specific event and let them post
to a third event queue. For sure this creates the
maximum overhead you can get. :-)

NutEventWaitMultiple() seems to be the best solution.
Not sure about its implementation. To speak with
Mathias' voice: Under all circumstances we must avoid
blowing up any critical sections.

Harald




More information about the En-Nut-Discussion mailing list