Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!pepper!cmcmanis From: cmcmanis%pepper@Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga.tech Subject: Re: Task KILL for Amiga Message-ID: <86258@sun.uucp> Date: 20 Jan 89 20:14:40 GMT References: <3716@crash.cts.com> <10908@s.ms.uky.edu> <5713@cbmvax.UUCP> <10926@s.ms.uky.edu> Sender: news@sun.uucp Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Organization: Sun Microsystems, Mountain View Lines: 53 In article <10908@s.ms.uky.edu> sean@ms.uky.edu (Sean Casey) asks: Does AmigaDOS track resources ? In article <5713@cbmvax.UUCP> jesup@cbmvax.UUCP (Randell Jesup) responds: No, not in general. It can get expensive in memory/speed to do so. In article <10926@s.ms.uky.edu> sean@ms.uky.edu (Sean Casey) writes: > Why? Seems to me that resource allocation is an infrequently done thing. > It also seems to me that resources could be tracked with bitmaps. Where > is the serious speed/memory degradation? > > Assuming I'm right, what's the REAL reason resources aren't tracked? Sean you are correct, and Randell is correct as well. Depending on your application, tracking resources may or may not be expensive and may or may not be useful. Take a spreadsheet for instance. Remembering that you have opened a screen and allocated some memory takes no time at all compared to the user who is sitting there walking through the menus to load a file. In this case resource tracking is inconsequential in terms of speed. Then consider an alien invaders game where you take over the machine. Since you are going to give back the machine by rebooting it you don't particularly care or want to deal with code that tracks resources. The philosophy behind the Amiga has traditionally been more of the latter and less of the former. However, that changes as more and more people write toolkits that *do* resource tracking. I have one where I just call ToolExit() and everything I've allocated/opened/used etc gets freed up for me. (no it isn't ready to go yet) This solves the problem for 99% of the programmers out there. I think you can expect to see something that does some resource tracking in 1.4 if not in ROM, then in the form of a library for programmers. But the question you *really* want answered is, "Why can't I kill a task and have all of it's resources freed ?" And there are two answers to that. One is "Why are you killing your task? Did it go astray?" If so, killing it and freeing a list of resources it thinks it has is a very dangerous proposition. Maybe it corrupted that list before it died and you end up freeing up the Workbench screen! Or maybe it wrote all over your filesystem handler which is now merrily corrupting your disks. Etc. Basically, you don't know so you are really in a tough spot. I prudent solution is to just guru out and reboot, if you are a gambler by nature then you'll use something like GOMF and hope it didn't do any real damage. So the real answer is why put a lot of effort into that senario when it may cause you nothing but grief. On memory protected systems where you can be sure the system is secure you will have a much better shot of doing it right. --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you.