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.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,fb45e48e8dddeabd X-Google-Attributes: gid103376,public X-Google-Thread: ffc1e,fb45e48e8dddeabd X-Google-Attributes: gidffc1e,public From: "Jean-Pierre Rosen" Subject: Re: Ada Protected Object Tutorial #1 Date: 1999/12/27 Message-ID: <847cg0$pmc$1@wanadoo.fr>#1/1 X-Deja-AN: 565256227 References: <839toq$pu$1@bgtnsc03.worldnet.att.net> <385AC716.7E65BD5C@averstar.com> <845pgk$qkf$1@nnrp1.deja.com> <846rk7$gba$1@nnrp1.deja.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 X-Complaints-To: abuse@wanadoo.fr X-Trace: wanadoo.fr 946287936 26316 164.138.50.136 (27 Dec 1999 09:45:36 GMT) Organization: Adalog X-MSMail-Priority: Normal NNTP-Posting-Date: 27 Dec 1999 09:45:36 GMT Newsgroups: comp.programming.threads,comp.lang.ada Date: 1999-12-27T09:45:36+00:00 List-Id: Robert Dewar a �crit dans le message : 846rk7$gba$1@nnrp1.deja.com... > In article , > kaz@ashi.footprints.net wrote: > > That's the sense that I get. For example, earlier in the > debate I was told that > > when the requirements change in certain ways, you have to > abandon protected > > objects. E.g. if you need an object's operation to call into > another subsystem > > which may call back. > > Really the point is that protected objects are best thought of > as a framework for constructing very simple synchronization > primitives with a minimum of active code. As soon as a protected > object acquires complex internal logic, it is better represented > by a separate Ada task. > I fully agree here, but there is another issue that is worth mentionning: If you use protected objects, all tasks are in the position of a *client*, which makes termination much more tricky. You must deal with termination by having explicit "termination" messages between tasks, and you must make sure that these messages are sent in all cases, including tasks terminating because of abort or unhandled exceptions. This can be made often automatic if you use rendezvous and an a terminate alternative. -- --------------------------------------------------------- J-P. Rosen (Rosen.Adalog@wanadoo.fr) Visit Adalog's web site at http://pro.wanadoo.fr/adalog