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,af960bc705aaf51b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-25 09:35:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.cwix.com!wn2feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3C7A75F2.30503@worldnet.att.net> From: Jim Rogers User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Complexity of protected objects References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 25 Feb 2002 17:35:45 GMT NNTP-Posting-Host: 12.86.33.107 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1014658545 12.86.33.107 (Mon, 25 Feb 2002 17:35:45 GMT) NNTP-Posting-Date: Mon, 25 Feb 2002 17:35:45 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:20382 Date: 2002-02-25T17:35:45+00:00 List-Id: Using a protected object to read and write files is a clear violation of the intention and recommendations for proctected objects. Protected objects should be non-blocking. I/O is always potentially blocking. You even have some potential blocking issues when storing an AVL tree. If you dynamically allocate your AVL tree nodes you have the possibility of running out of memory. This will either result in a blocking situation, or a potential loss of data in the AVL tree. I would be inclined to use a simple protected buffer object to communicate with one or more tasks for the reading and writing, and another task to store the AVL tree. Protected operations allow you to design a degree of asynchronisity into your system. They are not expected to replace tasks for all uses. Jim Rogers tony gair wrote: > I'm considering using a protected object to store an AVL tree and also to > write and read files, > normally I would have used tasks for this, but I wish to experiment > slightly. > > J Barnes recommends that protected objects be as small as possible, so > being a little > bloody minded I want to see what the limits are for protected objects , > I would be very interested to see unusual protected objects people have > created, which > do things protected objects were not designed for (is this an oxymoron?). > > > >