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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,260011f44e312a22,start X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!e1g2000hsh.googlegroups.com!not-for-mail From: stefanmairhofer@gmx.at Newsgroups: comp.lang.ada Subject: Observer Pattern / Concurrency with ObjectAda Followup-To: comp.lang.ada Date: Mon, 19 Nov 2007 03:07:34 -0800 (PST) Organization: http://groups.google.com Message-ID: <07095dbf-53a4-4cdb-a3bc-3302b499b98d@e1g2000hsh.googlegroups.com> NNTP-Posting-Host: 193.170.127.132 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1195470455 11229 127.0.0.1 (19 Nov 2007 11:07:35 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 19 Nov 2007 11:07:35 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e1g2000hsh.googlegroups.com; posting-host=193.170.127.132; posting-account=QUqSeAoAAAAvdvt7EPktC05s7QA6R6WJ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9,gzip(gfe),gzip(gfe) Content-Disposition: inline Xref: g2news1.google.com comp.lang.ada:18503 Date: 2007-11-19T03:07:34-08:00 List-Id: Hello! I'm currently working on a software-pattern based project with ObjectAda and I would require to implement an Observer pattern for my program. I've stumbled upon an example of the "Observer Pattern with an Concurrent Subject" from Matthew Heaney http://www.adapower.com/index.php?Command=Class&ClassID=Patterns&CID=287 And I was not able to run it on ObjectAda 7.2.2. Embedded (I get access-errors, constraint-errors and sometimes deadlocks). When I tried the program using MinGW with gccada it worked perfectly. Apparently the Attach and Detach functions do not work properly and in the main procedure Test_Observers the Clock declaration results in an Constraint_Error / access error procedure Test_Observers is Timer : aliased Clock_Timer; Clock : Digital_Clock (Timer'Access); -- <-- Constraint_Error begin ... (little help : Timer = subject, which includes a task that informs the observers via notify(), Clock = observer, which has the update() method) Any ideas why it works with GNAT, but not with ObjectAda? Thank you for your help! Best regards Mairhofer Stefan