2 Replies Latest reply on Nov 30, 2010 12:17 PM by 819822

    Questions about ReleaseParameters and WaitFreeReadQueue


      I would very appreciate your answers for the following two questions:

      1. When exactly do new ReleaseParameters come into effect for a RealtimeThread when its setReleaseParameters() method is called?

      2. A small scenario: two Producers and one Consumer communicate over a WaitFreeReadQueue. The Producers write periodically new data into the queue while the consumer dequeues on the other side. What happens (on Consumer side) if the Consumer is not able to keep up with both Producers and the queue is overfilled? Is it possible that this situation (in some way) causes deadline misses on the Consumer side?

      If my scenario is not clear enough and this is not a known behaviour of the Java realtime system, please let me know and I will include a code example too.

      Thank You in advance for answers.


      Edited by: Vladimir.Nikolov on Sep 22, 2009 8:52 AM
        • 1. Re: Questions about ReleaseParameters and WaitFreeReadQueue
          Hi Vladimir,

          The Real-Time Specification for Java defines precisely when ReleaseParameters changes take effect in the "Scheduling" section:


          The answer to your question depends on the class of the old and the new ReleaseParameters of the RealtimeThread. For instance, changing
          the release parameters of a RealtimeThread from PeriodicParameters to AperiodicParameters takes effect immediately unless the thread is blocked-for-release-event, in which case the change takes place after the next release event. However, if the release parameters are changed from PeriodicParameters to another PeriodicParameters, then the change takes effect on the first invocation of waitForNextPeriod() where the RealtimeThread is not in a deadline miss condition.

          If you have issues in finding out the right semantic for the kind of changes you want to perform, you can describe them more precisely and I'll provide you with the semantic that applies in this case.

          Regarding your Producers/Consumer scenario, the Consumer should not miss deadlines because it won't block on the read(). With a WaitFreeReadQueues, the read() method never blocks. However, if the queue is full, the Producers will block on the write() (remember, the WaitFreeQueues are fixed size data structures). The Producers remain blocked until the Consumer reads a values. Once the Consumer's read is performed, there's one free slot in the queue, so the blocked writers are unblocked, and one of them will complete its write().

          Frederic Parain
          • 2. Re: Questions about ReleaseParameters and WaitFreeReadQueue
            Regarding the Producer/Consumer Scenario.
            In the case of the writers being blocked, what is the case of more objects produced, and the queue is still full.