BSJR wrote:pjw wrote:I have it on a HOT_LOAD key, and just now disproved the assumption made in my previous message: Each HOT_LOAD instance loads a new copy of the program. (Funny the need was felt to add, and document, the "I" (for impure) parameter for HOT_LOAD then, as it doesnt make any sense.)
Of course HOT_LOAD1 and HOT_RES1 will pick an already Loaded or Resident copy of the program.
It depends on the program type which HOT_ option is the best to start with. I often run many QDs but only need one Xchange.
I did study the manual, Bob, back in the day

My point is that HOT_LOAD loads and executes a new copy on each call. That means that HOT_LOAD does not care about whether a program is impure or not. Hence no need to specify the I option, AFAICS.
The following information may or may not be clear from the documentation. I have gathered
this through observation and testing, not by reviewing the code. Please correct anything
you know to be wrong:
Code: Select all
Command type Self modifying Copies in memory
HOT_RES/HOT_CHP impure N + 1
HOT_LOAD pure/impure N
HOT_RES/HOT_CHP pure 1
where N = number of instances running, 0..
The reason impure code needs an extra copy is because this is the reference copy. After that,
each instance needs its own copy as each instance's code may be slightly different (eg due to
relocation) or change due to local circumstances while running.
In the case of HOT_LOAD, if no intances are running then no code is loaded.
For pure code invoked by HOT_RES/HOT_CHP, one copy of the code is alway present, whether
any instances are running or not.
Code loaded with HOT_CHP can be removed again, and its Hotkey released, with HOT_REMV.
Code loaded with HOT_RES, even if it does not actually end up in the Resident Procedure Area
(due to jobs running, etc) cannot be removed with HOT_REMV; only the Hotkey is detached.
The Thing and code are still present. There is no command in Hot_rext or SMSQ/E to remove
such a Thing, an external toolkit is required.
The HOT_XXX1 option only means that a given hotkey will never invoke more than one instance
of the program it refers to. If an instance is already running, it is Picked and Woken, otherwise
a first (and only) instance is invoked. This behaviour is the same for all the different
invocation types.