Ok, during summer months here in the Northern Hemisphere, my coding efforts are pretty darn low. However, every now and then I come up with some little things (issues) that I think need to be sorted out.
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.
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.
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.
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.
If I CreateNewProcTags() with NP_Child, TRUE,
is it safe to share interface handles with the child,
or should that child process OpenLibrary() and GetInterface() it's own stuff?
I would _THINK_ it's OK to share, but I'll ask to be sure.