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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fb45e48e8dddeabd X-Google-Attributes: gid103376,public From: Richard D Riehle Subject: Re: Ada Protected Object Tutorial #1 Date: 1999/12/27 Message-ID: <848ajb$o39$1@nntp2.atl.mindspring.net>#1/1 X-Deja-AN: 565377324 References: <839toq$pu$1@bgtnsc03.worldnet.att.net> <385AC716.7E65BD5C@averstar.com> <845pgk$qkf$1@nnrp1.deja.com> <846rk7$gba$1@nnrp1.deja.com> Organization: MindSpring Enterprises X-Server-Date: 27 Dec 1999 18:19:23 GMT Newsgroups: comp.lang.ada Date: 1999-12-27T18:19:23+00:00 List-Id: In article <846rk7$gba$1@nnrp1.deja.com>, Robert Dewar wrote: >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. Thanks for this clarification of your view. The originaly phrasing was something of a shock. The real issue is that, when designing for concurrency, one must select the mechanism best suited to the problem to be solved. Protected objects represent a significant improvement over semaphores for mutual exclusion but need to be used sparingly in a multi-tasking design. As your note implies, a protected object is not a substitute for a task. Then again, a task is not a substitute for a subprogram. The difficulty of designing with tasks is non-trivial, even when a rich set of mechanisms is available, as in Ada. Richard Riehle