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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Running a preprocessor from GPS? Date: Fri, 31 Jul 2015 09:29:19 +0200 Organization: A noiseless patient Spider Message-ID: References: <2df4698f-4c8e-457c-822d-209cb2f8ab5e@googlegroups.com> <014427b1-ff7a-4a69-82e6-0330af77ed96@googlegroups.com> <91f88d79-197c-419f-84a8-908e05967a2c@googlegroups.com> <135c2b00-d13c-4f5d-a586-8aca442d363b@googlegroups.com> <87380683vc.fsf@adaheads.sparre-andersen.dk> <347c6be9-c918-4bc0-9494-c93cd6740def@googlegroups.com> <4cb32c40-f659-490d-bbb6-73585fc069e8@googlegroups.com> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 31 Jul 2015 07:27:45 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="7745040322e5f5714135e312b677d998"; logging-data="13570"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/BNlEGO4IIWzg2qACgYJS/aEwCZqZND+c=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <4cb32c40-f659-490d-bbb6-73585fc069e8@googlegroups.com> Cancel-Lock: sha1:q7yIuBfNsNBVAPD2+P/A+2VUQCY= Xref: news.eternal-september.org comp.lang.ada:27253 Date: 2015-07-31T09:29:19+02:00 List-Id: On 30.07.15 22:53, EGarrulo wrote: > By "resource" I mean any resource -- like: database connections, > files, etc. -- that must be relinquished as soon as possible and that is > shared among different objects, in a way that makes it difficult for each object > to determine whether such resource is still needed by other objects or not. Of > course, this implies a dynamic environment that precludes the possibility of > creating all the needed resources in advance and then releasing them at the end > of computation. This kind of automatic resource management cannot be real: How could anything other than the entire collection of objects using the resource determine whether any one of them still needs the resource? Therefore, if you have several objects using the resource, possibly in different tasks, handle the resource with the help of a protected object. The protected object implements a protocol. An object wishing to use the resource will ask the PO for a handle, and will get one ASAP. In simple cases, the resource can be released by the PO as soon as all users have signaled to the protected object that they are done with the resource.