[Ace-users] [ace-users] General question re. synchronization

Stefan Naewe stefan.naewe at atlas-elektronik.com
Fri Feb 8 05:13:03 CST 2008


Hi all,

this is more of a general question and not only ACE-related,
therefor I skip the PRF this time... (I'm using the latest
ACE anyway...)

I need to write a "datagram sender" that sends some kind of
datagram in a (more or less...) fixed frequency, say 10Hz.
The sender receives the data it needs to send from another program
(the "producer") but in no fixed frequency, i.e. an update can
occurr any time. The producer is finished and not part of this
question/problem.

The sender only knows the size of the datagram it's going to send.
When the producer sends new data the sender obviously needs to
update its internal buffer and send the new data.

Now I'm trying to figure out how to synchronize (inside the sender!)
the receiving of the new data and the sending. Getting an update
must not block the sending in any way. It needs to stay at its fixed
frequency. But when an update occurred the next "cycle" of the sending
side needs to use the new data immediately.

I think I need:
  - some kind of double-buffering scheme
  - a way to tell the receiving side of the sender (got that?)
    that the sending side has finihed one cycle (condition var. ?)
  - a way to tell the sending side that new data has arrived (
    and that it needs to use the "other" buffer of the double-
    buffering scheme)

Could anyone help me with a general structure/concept?

Thanks in advance for any comment

Stefan
-- 
Stefan Naewe            stefan dot naewe at atlas-elektronik dot com
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html



More information about the Ace-users mailing list