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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Protected hash map (efficient programming with a protected type) Date: Thu, 16 Nov 2017 17:50:31 -0600 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Thu, 16 Nov 2017 23:50:31 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="24376"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: feeder.eternal-september.org comp.lang.ada:48940 Date: 2017-11-16T17:50:31-06:00 List-Id: "Victor Porton" wrote in message news:oukt7t$1ifn$1@gioia.aioe.org... > Process_Descriptor record consists of a process ID (an integer), two file > descriptors (for stdin and stdout). Process descriptors may also contain > two > strings: program input string (formed before the program started) and > program output string (which is appended every time we get some output > from > the program). It may contain more data. I'm not sure I understand. In every system that I've ever used, there can only be one set of process descriptor information for each process ID. That means the other data is secondary to the process ID, and the ID alone is sufficient to determine the other information. Specifically, a running process (with a particular ID) has StdIn and StdOut file descriptors. But there never are two copies of the same process (with the same ID) with different StdIn and StdOut information; those necessarily have to be different processes with different IDs. (Perhaps something could change the StdIn or StdOut file descriptors, but you wouldn't keep the old ones in such a case.) Thus, I'd index the map using the process ID (which is typically a small integer), and use that to retrieve the other information as needed. If the process ID is destroyed, one needs a mechanism to remove it (and thus the other information) from the map. But that can be implemented with just a normal Delete (assuming the Map is implemented with one of the Ada Containers). Randy.