comp.lang.ada
 help / color / mirror / Atom feed
* Protected Objects (Geeenhills & VxWorks)
@ 2000-02-10  0:00 R. Tim Coslet
  2000-02-10  0:00 ` Tucker Taft
  0 siblings, 1 reply; 7+ messages in thread
From: R. Tim Coslet @ 2000-02-10  0:00 UTC (permalink / raw)


We have been having repeated problems where Protected Objects don't seem
to be functioning correctly in the environment we are working with
(Greenhills V1.8.9 w/ VxWorks).

The simplest case I have is the following...

   protected body Example_Protected_Object is

      entry Send when Available or
                                I_Am_Tired_Of_Waiting is
      begin

         -- Do some things here...

         -- reset the barrier flags
         Available := False;
         I_Am_Tired_Of_Waiting := False;

         -- reset the waiting flag
         Waiting_For_It := False;

      end Send;

      procedure Signal_Available is
      begin

         -- set the barrier flag to indicate data has been received
         Available := True;

      end Signal_Available;

      procedure Check_For_Timeout is
      begin

         -- set the barrier flag to indicate data has not been received
         I_Am_Tired_Of_Waiting := Waiting;

         -- set the waiting flag
         Waiting := True;

      end Check_For_Timeout;

   end Example_Protected_Object;


The entry (Send) is called from one task, to hold it until data arrives.

The procedure (Available) is called from a task that is triggered by an
interrupt.
The procedure (Check_For_Timeout) is called from the main program loop,
running at a lower priority than the other two tasks.

When everything is working normally, Available is called following the
interrupt processing and the queued call to Send is released from its
barrier. Check_For_Timeout is also periodically called by the main
program and as expected nothing happens.

When I prevent Available from being called however the system locks up.
This is not what I expected. I expected the call to Check_For_Timeout by
the main program to release the queued call to Send from its barrier.

Am I using the protected object correctly, or is something broken in the
Greenhills implementation of protected objects? I strongly suspect
Greenhills as I have read the LRM sections repeatedly and they seem to
say this should work and we were previously forced to convert all
protected object Interrupt Handlers to direct calls to VxWorks services
(bypassing the Ada implementation).

            R. Tim Coslet
            CosletT@KaiserE.com





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-02-10  0:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-10  0:00 Protected Objects (Geeenhills & VxWorks) R. Tim Coslet
2000-02-10  0:00 ` Tucker Taft
2000-02-10  0:00   ` R. Tim Coslet
2000-02-10  0:00   ` R. Tim Coslet
2000-02-10  0:00   ` R. Tim Coslet
2000-02-10  0:00     ` DuckE
2000-02-10  0:00       ` R. Tim Coslet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox