From fnaumann@mail.cs.uni-magdeburg.de Sun Sep 12 23:46:36 2004 Date: Sat, 11 Sep 2004 20:32:25 +0200 From: Ingo Schmidt X-Mailer: The Bat! (v2.11.02) CD5BF9353B3B7091 Reply-To: Ingo Schmidt X-Priority: 3 (Normal) Message-ID: <446220110.20040911203225@der-ingo.de> To: MiNT-Liste Subject: Re: [MiNT] Pmsg() usage In-Reply-To: <41419C3C.6080002@utbm.fr> References: <41419C3C.6080002@utbm.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:dfcedd4b8f9cfccb451515f58bff954c Delivered-To: mint@fishpool.com Delivered-To: mint@lists.fishpool.fi X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: ich@der-ingo.de Precedence: bulk List-help: List-unsubscribe: List-ID: X-List-ID: X-Milter: ClamAV 0.70/0.70kjel X-Milter: milter-regex 1.5jel X-Milter: ClamAV 0.70/0.70kjel X-Milter: milter-regex 1.5jel Hi! OL> I have 2 programs one is something like this: I use pmsg in exactly that situation and it works fine for me. I guess you want to synchronize two processes with that, right? Out of my experience the best way is to always use 0xffff0000+my_pid as mailbox id for receiving messages and 0xffff0000+receiver_pid as mailbox id for sending. An example: There are two processes, A and B with pids 1 and 2. Now lets do your scenario: Program A has this code: pmsg(0,0xffff0001,&r); printf("A: message received\n"); printf("A: Sending message..."); pmsg(1,0xffff0002,&r); printf("OK\n"); Pterm(); Program B has this code: pmsg(2,0xffff0001,&r); printf("B: message received\n"); Pterm(); Now start program A and then program B and everything will work fine. Also consider that in pmsg mode 2 the mailbox id for sending and receiving are usually different (unless you use mailbox IDs like described above). I hope this helped. Cheers, Ingo =;->