Scott,
I didn't say anything about wanting everything to start up at once. I
said "one startup cost", meaning for global resources in a service
program. Sorry to be unclear...
I didn't realize *new was exclusive to programs... We use named
activation groups anyway, with sparing use of *new for utility programs
and whatnot...
Yes, you got to what I had meant to convey.
Thanks,
-Eric
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Monday, November 08, 2010 1:04 PM
To: RPG programming on the IBM i / System i
Subject: Re: Size of Service Program
On 11/8/2010 12:28 PM, DeLong, Eric wrote:
As always, when a service program module gets activated, storage must
get allocated and initialized, which is costly.
Some storage, yes... but not all storage is allocated when a service
program is activated.
The whole idea of activation groups is to all ONE startup cost
(activation), with reuse of the already activated code as needed.
I don't agree with that assessment at all. Activation groups have
several purposes, but "loading everything at once" is not one of them.
They do provide a way to _keep_ things activated so you don't have to
pay the activation cost multiple times... but I don't think they expect
you to activate everything at once in "one startup cost."
If you do something silly, like making your service program module
start ACTGRP(*NEW), your huge service program could be a performance
nightmare.
The CRTSRVPGM command doesn't offer the option of ACTGRP(*NEW).
Where, I'm a little fuzzy is whether all modules in a particular
service
program are activated at the same time. We only use single-module
service programs here, so I haven't had to deal with this yet.
Activation is done by the *PGM/*SRVPGM. Modules are just building
blocks of *PGM or *SRVPGM objects and are not used at run-time.
However, the files that are global to a given module are opened the
first time a procedure from that module is *called*, therefore the first
time you call any procedure in a module, there's an extra startup cost.
That might be what you're thinking of? Technically the modules aren't
used at that point, but there are still resources scoped to the routines
that came from a particular module.
As an Amazon Associate we earn from qualifying purchases.