From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7939 invoked by alias); 18 Jul 2002 11:02:18 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 7914 invoked from network); 18 Jul 2002 11:02:16 -0000 Received: from unknown (HELO mail4.svr.pol.co.uk) (195.92.193.211) by sources.redhat.com with SMTP; 18 Jul 2002 11:02:16 -0000 Received: from [195.92.168.141] (helo=tmailb1.svr.pol.co.uk) by mail4.svr.pol.co.uk with esmtp (Exim 3.35 #1) id 17V931-0003H0-00 for ecos-discuss@sources.redhat.com; Thu, 18 Jul 2002 12:02:15 +0100 Received: from modem-3625.python.dialup.pol.co.uk ([217.134.222.41] helo=PC-PETER2.cis.strath.ac.uk) by tmailb1.svr.pol.co.uk with esmtp (Exim 3.35 #1) id 17V930-0001KR-00 for ecos-discuss@sources.redhat.com; Thu, 18 Jul 2002 12:02:15 +0100 Message-Id: <5.1.0.14.0.20020718113159.025c3008@pophost.cs.strath.ac.uk> X-Sender: peter@pophost.cs.strath.ac.uk Date: Thu, 18 Jul 2002 04:02:00 -0000 To: ecos-discuss@sources.redhat.com From: Pete Barrie Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: [ECOS] Message boxes - good/bad practices X-SW-Source: 2002-07/txt/msg00263.txt.bz2 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 send message to thread_Rx with buffer ptr ---- ---- wait for reply_message from thread_Rx fill buffer 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