RE: SDL-News: How to build a bounded queue in SDL?

Subject: RE: SDL-News: How to build a bounded queue in SDL?
From: Frend Patrick-BPF005 (
Date: Thu Jul 22 2004 - 09:56:34 GMT

Simple, but not very elegant solution.

Declare a union containing structs which contain all of the parameters of all of the signals that need to be received.

Declare an array of that union the relevant size to limit the size of the queue.
Keep a Head and Tail count which turns the array into a queue.
You may want to wrap this up in an ADT.

Receive each signal into the array element at the tail of the queue and move the tail pointer.

Send the signal at the head of the queue (on a timer expiry?) and move the head pointer.
You need to switch on the contents of the union to decide which signal to send. The send will need to be sent VIA a route or gate, or TO a Pid to avoid sending it to yourself.

Hope this helps.

-----Original Message-----
From: [] On Behalf Of D Wang, Electrical & Electronic Engineering
Sent: 22 July 2004 10:22
Subject: SDL-news: How to build a bounded queue in SDL?

Dear friends,
Sorry to send the question on building a queue in SDL again. The attached
file depicts the question clearer. Could you offer some suggestions please? Thanks a lot! Best regards, Gary

This archive was generated by hypermail 2a23 : Thu May 09 2013 - 16:05:50 GMT