Path: utzoo!attcan!uunet!super!udel!gatech!ukma!sean From: sean@ms.uky.edu (Sean Casey) Newsgroups: comp.sys.amiga.tech Subject: Re: Task KILL for Amiga Message-ID: <10938@s.ms.uky.edu> Date: 22 Jan 89 09:05:37 GMT References: <3716@crash.cts.com> <10908@s.ms.uky.edu> <5713@cbmvax.UUCP> <10926@s.ms.uky.edu> <32094@tut.cis.ohio-state.edu> Reply-To: sean@ms.uky.edu (Sean Casey) Organization: The Leaning Tower of Patterson Office @ The Univ. of KY Lines: 49 In article <32094@tut.cis.ohio-state.edu> Jeff Martens writes: |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. |Resource allocation is infrequently done in a language like FORTRAN |which has a static view of the world and doesn't allow users to |allocate and deallocate memory. In something more modern, like Modula |2, Pascal, Lisp, or C, this is no longer true. Consider linked lists, |trees, etc.; to manage these sorts of structures in an application |program you're continuously grabbing new memory and (hopefully) |returning it to the system when you're done with it. Even if you're |just running FORTRAN or BASIC, the translator is going to allocate |memory dynamically. I still say that resource allocation is an infrequently done thing. I use malloc(), (and brk(), and sbrk()!) on Unix just as much as the next guy. Just because the "better" languages encourage dynamic memory allocation doesn't mean it's done all the time. Yes, some applications do it all the time, but most do it infrequently. |>It also seems to me that resources could be tracked with bitmaps. Where |>is the serious speed/memory degradation? |OK. Let's keep track of every byte of RAM in the Amiga. If we allow |for 8MB of RAM, then we need an 8Mb map, which comes to a megabyte. |If we increase the granularity to, |say, a "paragraph" (Intel's term for 16 bytes if memory serves), then |8MB is thought of as 512k paragraphs, so the bitmap can fit in 64kB. Allocating memory in units this small is insane! Name an operating system that allocates in units that small! In reality, we use pages of 512 to 2048 bytes. If we use one BYTE per page, and 1K page size, we need 512 BYTES on a half meg box. That ain't bad. Keep track of EVERY byte, suuuuuure. |Of course, it's not necessary to worry about memory that's not |actually present. Assuming memory's allocated on a word basis, |though, a sixteenth of your memory's gonna be just bitmaps, and this |is pretty significant. Wrong. More like 1/500 to 1/1000 of your memory. Sean -- *** Sean Casey sean@ms.uky.edu, sean@ukma.bitnet *** Who sometimes never learns. {backbone site|rutgers|uunet}!ukma!sean *** U of K, Lexington Kentucky, USA ..where Christian movies are banned. *** ``There's only TWO THINGS come out of Oklahoma...''