Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!husc6!linus!mbunix!eachus From: eachus@mitre-bedford.ARPA (Robert Eachus) Newsgroups: comp.sys.amiga.tech Subject: Negative Open Counts (was Re: IEEE libraries) Summary: A compatible fix. Keywords: open counts Message-ID: <39822@linus.UUCP> Date: 12 Sep 88 19:02:13 GMT References: <1356@percival.UUCP> <358@boing.UUCP> <1570@sbcs.sunysb.edu> <362@boing.UUCP> Sender: news@linus.UUCP Reply-To: eachus@mitre-bedford.ARPA (Robert I. Eachus) Distribution: na Organization: The MITRE Corporation, Bedford, Mass. Lines: 35 What we need is an upwardly compatible solution which does not cause existing correct programs to Guru if some other task fouls things up. The following suggestion points the way: >In article <1570@sbcs.sunysb.edu> root@sbcs.sunysb.edu (root) writes: >> >> No, please no more GURU conditions. It seems to be that a reasonable >> thing to do is when the count would go negative just mark the >> library as permanently open and ignore any further closes. If setting the open count negative makes a library permanently resident (at least till the next warm boot, or someone intentionally diddles the bits) we get the following rule: When a library is opened by a task, if the (open) count is non-negative, increment it by one. When a library is closed decrement the count by one. Libraries may only be unloaded when the count is zero. Simple and sweet. I like the idea of ratcheting the count down, but setting all negative counts to minus one or some other value is equally acceptable. In any case, other than to very simple OS changes, no fuss, no bother. It might be nice to add a make permanently resident call, and a force unload utility, but these are frills. And it is all very useful. A library could force itself to stay resident if it opened a resouce behind the users back when it needed to maintain state. (Such a library would have to track itself, but this shouldn't be hard if it is needed.) Robert I. Eachus with STANDARD_DISCLAIMER; use STANDARD_DISCLAIMER; function MESSAGE (TEXT: in CLEVER_IDEAS) return BETTER_IDEAS is...