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.1 required=5.0 tests=BAYES_05,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,2c6139ce13be9980 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,3d3f20d31be1c33a X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,2c6139ce13be9980 X-Google-Attributes: gid1108a1,public X-Google-Thread: f43e6,2c6139ce13be9980 X-Google-Attributes: gidf43e6,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Safety-critical development in Ada and Eiffel Date: 1997/08/13 Message-ID: #1/1 X-Deja-AN: 263999861 References: <33F20113.738F@link.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.object,comp.software-eng,comp.lang.ada,comp.lang.eiffel Date: 1997-08-13T00:00:00+00:00 List-Id: In article <33F20113.738F@link.com>, Samuel Mize wrote: >Don Harrison wrote: >> >> Jon S Anthony wrote: >[about Ada protected objects] >> :The objects can be unlocked for >> :_read_ access, but never for any update access. >> >> Care to give an example? > >"Locked" is a common term, but its application to Ada is not >defined by the Ada Reference Manual (ARM), so it may be >unclear or accidentally misleading. >The ARM refers to protected operations being "blocked" if they >cannot "acquire" the "execution resource associated with a >protected object" (ARM 9.4(18)). No, that's not how the RM defines "blocked". A task is blocked when it is sitting on an entry queue, waiting for the barrier to become true, and in various other situations, but it is not considered blocked when it is waiting for the lock on a protected object. It does have to wait for the lock, of course, but we don't call that state "blocked". To answer Don's question: protected objects can be locked for read-only access, or for read-write access. Read-only access does not exclude other readers. The Ada folks seem to be missing Don's earlier point, which is that in Eiffel you can lock a bunch of objects all at once, whereas in Ada, you lock just one object at a time (that is, a protected operation X.Op(Y, Z) locks X, but not Y and Z (in Ada). >In other words, a protected object can have functions and >procedures (treating entries are a type of procedure). The difference between protected procedures and entries is that entries can "block" (in the Ada RM sense), whereas protected procedures cannot. - Bob