Exec

Example Library Code

I've been working on a datatype lately. Since datatypes are built on top of Exec libraries, I've been spending some time looking at example library code, including skeleton code created by tools like IDLTool and LDCK. I've found an unsettling number of inconsistencies in the ways these different code examples work.

Forums: 

Has anyone considered implementing a cleanup stack?

As a possible solution for resource tracking that could be applied retroactively, has anyone ever considered implementation of a cleanup stack?

A cleanup stack is a thread (task) specific 'stack' structure containing a copy of the handles of all your dynamic allocations. Then, if your task exits unexpectedly, or doesn't exit at all, the kernel can still unload all the resource allocations, in the reverse order they were allocated, and get the memory back, close the windows, close the file handles etc.

Forums: 

Is it considered bad form to reuse memory for devices and ports?

Some things in AmigaOS need a few objects allocated before they can be used. For example, to use a device, it needs a port and IO Request allocated before it can even be opened. And in extra cases, if a device is used as a function base, more needs to be opened again, in order to access the library functions.

Forums: 

We don't have a simple alarm function?

From time to time I've wanted to set an alarm. But I noticed we didn't have a simple function set for doing so. Such as attaching it to a signal.

I imagine it would be useful to have such a function in the kernal of Exec. But even in the updated OS4 Exec I see none. Whatever is used by Exec for the underlying timer would be hidden away with just functions to set up an alarm and attach to a signal or return a signal.

Forums: 

Pages

Subscribe to RSS - Exec