From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!bloom-beacon!mit-eddie!uw-beaver!uw-june!fred.cs.washington.edu!tancheeh From: tancheeh@fred.cs.washington.edu (Nicholas Tan Chee Hiang) Newsgroups: comp.lang.ada Subject: shared variable between tasks Message-ID: <8610@june.cs.washington.edu> Date: 29 Jun 89 02:07:58 GMT Sender: news@june.cs.washington.edu Reply-To: tancheeh@fred.cs.washington.edu (Nicholas Tan Chee Hiang) Organization: University of Washington, Computer Science, Seattle List-Id: I am trying to understand concurrency in Ada. Can someone please tell me why the variable Unprotected below is never updated? Thanks! - N ------------------------------>code below<------------------------------ with Text_IO; use Text_IO; procedure Unprotected_Shared_Variable is Unprotected : Character := '*'; pragma SHARED(Unprotected); task Write_Letter_A_To_Variable; task Access_Variable; task body Write_Letter_A_To_Variable is Letter : constant Character := 'A'; begin loop Unprotected := Letter; delay 0.5; end loop; end Write_Letter_A_To_Variable; task body Access_Variable is Letter : Character := Unprotected; begin loop Put (Letter); delay 3.0; end loop; end Access_Variable; begin null; end Unprotected_Shared_Variable;