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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6009c73a58f787a0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-16 10:06:33 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.gtei.net!newsfeed1.cidera.com!Cidera!cyclone.socal.rr.com!cyclone3.kc.rr.com!news3.kc.rr.com!typhoon.san.rr.com!not-for-mail Message-ID: <3C45C12D.A229F569@san.rr.com> From: Darren New X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How to avoid unreferenced objects (mutexes etc) References: <3c3ee8c8.105408250@News.CIS.DFN.DE> <3c429d1c.2624281@News.CIS.DFN.DE> <3C445F34.44697AEF@san.rr.com> <3C44CFBD.BC1ED52F@san.rr.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 16 Jan 2002 18:07:22 GMT NNTP-Posting-Host: 66.75.151.160 X-Complaints-To: abuse@rr.com X-Trace: typhoon.san.rr.com 1011204442 66.75.151.160 (Wed, 16 Jan 2002 10:07:22 PST) NNTP-Posting-Date: Wed, 16 Jan 2002 10:07:22 PST Organization: Road Runner Xref: archiver1.google.com comp.lang.ada:18976 Date: 2002-01-16T18:07:22+00:00 List-Id: Stephen Leake wrote: > Hmm. Entries with guards only occur in protected objects, not tasks > (unless I'm really confused). So I'll assume we are talking about > protected objects here. Errr, no. I'm pretty sure a selective accept works in tasks. > It's true that an entry (in either a task or a protected object) can > be dispatching. But you can provide a guard in the parent task, that > uses a function that is dispatching: > > entry Foo (...) when T.Bar; > > This appears to be legal when T.Bar is dispatching, but I've never > tried it. Yes. But the problem is in the callee you want a selective accept, and in the caller you want a conditional entry, and you don't want those two tied together at compile time. In that case, you're screwed. If you could derive a task type from another task type, I'd be fine; that is, if I could have multiple different task bodies for the same task type, I'd not have had even conceptual problems. > Maybe you can invert this; define the tasks in the framework code, > with a standard set of entries, but have each entry call a function > via dispatching, and allow the user to override those functions. This > is the structure used by Borland's Object Windows Library. Basically, what I wound up doing was saying "I'll dispatch to your objects, and you must not block. If you block, you will wedge up every task trying to do I/O. Caveat emptor." Then I provided a library of ways of getting called without blocking when you're busy, such as marshalling up the arguments and queueing them, with a task that loops and dequeues the arguments. In other words, I reimplemented Ada's entry queues. > > > I haven't found a need for extensible tasks. > > > > I have, but then that's the kind of software I write. > > To be precise, you have a need for dispatching in a tasking context, > and tried a design approach that doesn't work in Ada. There are other > approaches; if one of them works, you have not found a need for > extensible tasks :). Well, sure, I could write a Java JVM in Ada and then I'd not need any extensions to Ada. That's not to say it's an appropriate solution. Personally, I don't think reimplementing the entry concept in Ada source code should be necessary. -- Darren New San Diego, CA, USA (PST). Cryptokeys on demand. The opposite of always is sometimes. The opposite of never is sometimes.