home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: pc123@phx.cam.ac.uk
-
- Please mail queries about this code to the above address, not to your
- local comp.sources.acorn moderator! ;-)
-
- Pete says:
- Here is the code to demonstrate how you can pre-empt a non-desktop program
- without running it in a taskwindow or under FrontEnd, as I promised on c-s-a
- recently. The code implements a module which acts a bit like FrontEnd but is a
- tinsy bit more efficient in its use of RMA; it should be possible to convert it
- for multitasking raytracers or other code you are writing without too much
- difficulty.
-
- The module writes all output generated by the program into a circular buffer at
- a fixed offset in its workspace - a desktop task then uses the OS_Module call
- to find out where the workspace is, and reads data out. The effect is that
- text produced by a program is not stored in the RMA, so excessive fragmentation
- does not occur. This also implies that this module is only the "business end"
- of a complete FrontEnd replacement, and you have to write a desktop client
- program as well, to display output produced by a task in a window. I am not
- posting the client here, because this source is really for illustration only.
-
- The module also allows the task it is running to be stopped and restarted under
- control of the controlling program. This is accomplished by writing various
- values into another word at a fixed offset in the module's workspace.
- Similarly the module may be asked to kill the program it is pre-empting (never
- scheduling it again, and closing all its files) or terminate it (call its exit
- handler).
-
- As I wrote Express Assembler, the module is written in Express format. You
- shouldn't have too much trouble understanding it, as it does not use any fancy
- features.
-
- It is well known that only Quiche Eaters comment their programs well. I have
- added a few, but...
-
- ...if you find you need help following it, send me mail and I will do my best
- to help. Or flame about it on c-s-a instead :-) .
-
-
-