Thread View: comp.sys.apple2.gno
7 messages
7 total messages
Started by James L. Brookes
Tue, 05 Jan 1993 01:22
Idea for improved user control of restart flag.
Author: James L. Brookes
Date: Tue, 05 Jan 1993 01:22
Date: Tue, 05 Jan 1993 01:22
51 lines
2678 bytes
2678 bytes
To be brief, my idea is something of a blend of the Orca method (which
has some problems) and the normal GS/OS method (which is not user
configurable in general).
Start off with a SYSCMD like file somewhere, probably in the $home. When
the system starts up, it can read this file and hash the various commands
in the table for nice quick lookup.
A small modification to rexit() is required: it would call a kernel/shell
routine which would look up the filename and see if it is to be restartable
or not. If it is marked as restartable, then it exits with the proper
GS/OS QuitGS bits set. Otherwise, it exits as non-restartable. If
the filename or config file is not found, it would exit as restartable.
The beauty of this setup is that it circumvents the Orca problem: programs
which should not be restartable, because they assign constants to variables
at compile time. If the program doesn't explicitly call rexit(), it will
exit() as normal.
Now, is this important enough to be configurable? I for one know that
since I have plenty of memory, I can leave everything restartable. Of
course, I suppose that I could run out of stack space pretty quickly
that way...
To make this work for many different users, the shell would probably have
to be the one to support it.
Potential drawbacks:
- Slower startup time, more memory used for resident hash table
shouldn't matter, both should be pretty minimal.
- Programs would have to be recompiled with the new rexit().
not a problem: old programs will still behave as they do now,
as the old rexit just exits with the restart flag set. Of course,
this could cause some confusion among the users, but I think it
is worth the potential hassle.
- It will take time to implement when the time could be spent on other
more valuable things.
Dunno, how long would this take to write?
So, is it worth adding? Comments anyone?
--
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
| James Brookes | Inet: bb252@cleveland.freenet.edu |
|``What, me worry?'' - A. E. Neuman | jamesb@cscihp.ecst.csuchico.edu |
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Re: Idea for improved user control of restart flag.
Author: Jawaid Bazyar
Date: Tue, 05 Jan 1993 04:49
Date: Tue, 05 Jan 1993 04:49
15 lines
1158 bytes
1158 bytes
jamesb@ecst.csuchico.edu (James L. Brookes) writes: >So, is it worth adding? Comments anyone? IMHO, no. The ORCA method was created because at one time GS/OS didn't support restarting through the Quit call. It does now, and thus is the standard. If a program does rexit(), then it should be restartable, period. If the memory is needed the Memory Manager will purge the restartable image anyway. -- Jawaid Bazyar | Ask me about the GNO Multitasking Environment Procyon, Inc. | for the Apple IIgs! bazyar@cs.uiuc.edu | P.O Box 620334 --Apple II Forever!-- | Littleton, CO 80162-0334 (303) 933-4649
Re: Idea for improved user control of restart flag.
Author: James L. Brookes
Date: Tue, 05 Jan 1993 20:01
Date: Tue, 05 Jan 1993 20:01
42 lines
2813 bytes
2813 bytes
In article <bazyar.726209355@teal> bazyar@teal.csn.org (Jawaid Bazyar) writes: >jamesb@ecst.csuchico.edu (James L. Brookes) writes: > >>So, is it worth adding? Comments anyone? One reason I asked this, is because uEmacs has a variable to control restartibility. Does anyone actually turn this off? > IMHO, no. The ORCA method was created because at one time GS/OS >didn't support restarting through the Quit call. It does now, >and thus is the standard. If a program does rexit(), then it should >be restartable, period. If the memory is needed the Memory Manager >will purge the restartable image anyway. So, then should all apps be written to use rexit()? I don't really see any reason to -not- make an app restartable, but then I have 4.25 megs of memory, and want -everything- restartable :) Hm, a couple of questions I just thought of re: restartability: I've noticed that, if I have a restartable program running in the background, and try to run the same application in the foreground, it will not restart. No surprise, that's to be expected. But, even after one execution, this copy of the app won't restart. So, is it to be presumed that there can only be one copy of a given restartable application in memory at a time? Is it possible, in a multiuser system, for someone (for example) on console to use a restartable program, then exit, and for another person not on console to use the copy in memory? On the i/o-slow GS, restartability would be a great boon in a multiuser system. Running a cached application would allow the rest of the system to operate at the same time, instead of lagging as the disk is accessed. Allowing multiple copies of cached applications in memory would be nice but I guess that isn't the way it works. > Jawaid Bazyar | Ask me about the GNO Multitasking Environment > bazyar@cs.uiuc.edu | P.O Box 620334 -- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | James Brookes | Inet: bb252@cleveland.freenet.edu | |``What, me worry?'' - A. E. Neuman | jamesb@cscihp.ecst.csuchico.edu | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Re: Idea for improved user control of restart flag.
Author: Jawaid Bazyar
Date: Tue, 05 Jan 1993 21:04
Date: Tue, 05 Jan 1993 21:04
37 lines
2348 bytes
2348 bytes
jamesb@ecst.csuchico.edu (James L. Brookes) writes: >One reason I asked this, is because uEmacs has a variable to control >restartibility. Does anyone actually turn this off? Why? :-) >So, then should all apps be written to use rexit()? I don't really see >any reason to -not- make an app restartable, but then I have 4.25 megs >of memory, and want -everything- restartable :) Well, some applications would take a LOT of work to make restartable. That is, excepting the trick that Morgan Davis used to make uEmacs restartable. I don't know that his technique will work with ORCA/C, though. >Hm, a couple of questions I just thought of re: restartability: >I've noticed that, if I have a restartable program running in the >background, and try to run the same application in the foreground, it will >not restart. No surprise, that's to be expected. But, even after one >execution, this copy of the app won't restart. So, is it to be presumed >that there can only be one copy of a given restartable application in memory >at a time? Is it possible, in a multiuser system, for someone (for example) >on console to use a restartable program, then exit, and for another person >not on console to use the copy in memory? Yes, but not simultaneously. GNO specifcally reloads a program from disk if a restartable executable is running and another copy is requested. The system loader simply doesn't deal with more than one restartable copy of a program at one time. -- Jawaid Bazyar | Ask me about the GNO Multitasking Environment Procyon, Inc. | for the Apple IIgs! bazyar@cs.uiuc.edu | P.O Box 620334 --Apple II Forever!-- | Littleton, CO 80162-0334 (303) 933-4649
Re: Idea for improved user control of restart flag.
Author: Phillip Vandry
Date: Wed, 06 Jan 1993 01:52
Date: Wed, 06 Jan 1993 01:52
25 lines
1590 bytes
1590 bytes
jamesb@ecst.csuchico.edu (James L. Brookes) writes: [Stuff about adding SYSCMND to GNO] >So, is it worth adding? Comments anyone? Buy why? If a program assigns constants to variables then it should exit() and if it was written to be restartable it should rexit(). That's all there is to it. There is no reason to let the user control the restartability. To let the user change the restartability implies that some people might not like the default. But... If the program is restartable and you want to make it non restartable, well... Why would you? No gain... If the program is non restartable and you want to make it restartable, well... Why would you? You'd screw up your system. >| James Brookes | Inet: bb252@cleveland.freenet.edu | ______________________________________________________________________ |~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~| | Phillip Vandry | Vandry@Cam.Org | II the future! | II 1993! | |________________|________________|________________|___________________| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Re: Idea for improved user control of restart flag.
Author: Phillip Vandry
Date: Wed, 06 Jan 1993 02:05
Date: Wed, 06 Jan 1993 02:05
60 lines
3157 bytes
3157 bytes
jamesb@ecst.csuchico.edu (James L. Brookes) writes:
>I've noticed that, if I have a restartable program running in the
>background, and try to run the same application in the foreground, it will
>not restart. No surprise, that's to be expected. But, even after one
>execution, this copy of the app won't restart. So, is it to be presumed
>that there can only be one copy of a given restartable application in memory
>at a time? Is it possible, in a multiuser system, for someone (for example)
>on console to use a restartable program, then exit, and for another person
>not on console to use the copy in memory?
Oh, wait a minute. You bring up some interesting things here.
Let's say you start a second instance of a restartable program. Is it logical
to simply duplicate the existing copy rather than get it from disk? I think
not for two reasons. 1. You can't relocate it again. 2. [Explained below]
Also, if a process is kill(SIGKILL)ed, (or other "destructive" signal), it
should never be restarted from memory. Here's why:
If I wrote a program that changes itself (or even changes a GS/OS parameter
block) then changes itself back (which I do often) I would make this program
restartable (assuming the rest of the program is restartable). Sure it assumes
that a certain address will contain a certain value, and that value gets
changed later, but it gets changed right back, and unless the program exits
between the changing and the changing back, it's ok. The problem is that the
SIGKILL could easily occur between the two.
Example:
main lda refnum
sta readrec+2
ReadGS readrec
lda #500
sta len
ReadGS readrec
lda #200
sta len
...
readrec dc i'2'
ds 2
dc a4'buffer'
len dc i4'200'
ds 4
This fragment reads 700 bytes. The first read assumes that len will be set to
200. Unless the program exits while it is temporarily at 500, it will in fact
be at 200.
Yesterday I would have made this program restartable, but now I see that it is
not since the program could die while len is set to 500.
What is the solution?
>| James Brookes | Inet: bb252@cleveland.freenet.edu |
______________________________________________________________________
|~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~|
| Phillip Vandry | Vandry@Cam.Org | II the future! | II 1993! |
|________________|________________|________________|___________________|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Re: Idea for improved user control of restart flag.
Author: David.Empson
Date: Wed, 06 Jan 1993 07:48
Date: Wed, 06 Jan 1993 07:48
40 lines
2524 bytes
2524 bytes
In article <1icpfiINNd21@charnel.ecst.csuchico.edu> jamesb@ecst.csuchico.edu (James L. Brookes) writes: > > So, then should all apps be written to use rexit()? I don't really see > any reason to -not- make an app restartable, but then I have 4.25 megs > of memory, and want -everything- restartable :) If a program relies on its variables being cleared on startup, and they've been modified by a previous execution, it wouldn't be restartable. Making the variable segment 'reload' can get around this problem (but this isn't easy to do with the standard linker). > Hm, a couple of questions I just thought of re: restartability: > > I've noticed that, if I have a restartable program running in the > background, and try to run the same application in the foreground, it will > not restart. No surprise, that's to be expected. But, even after one > execution, this copy of the app won't restart. So, is it to be presumed > that there can only be one copy of a given restartable application in memory > at a time? The System Loader keeps track of the application's pathname and user id. It is not safe to have the same user ID for two different pathnames; nor is it safe to have two different user IDs for the same pathname. > Is it possible, in a multiuser system, for someone (for example) > on console to use a restartable program, then exit, and for another person > not on console to use the copy in memory? For simultaneous use by two people, the program would require two sets of variables. Since the addresses of the variables are patched into the program at load time, you would need to load a new copy of the program to refer to a different set of variables. It can't be done, with the current System Loader architecture. -- David Empson Internet: David.Empson@bbs.actrix.gen.nz EMPSON_D@kosmos.wcc.govt.nz Snail mail: P.O. Box 27-103, Wellington, New Zealand
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads