|
Scott - First, let me say that I am not 'blaming' anyone or anything. I'm simply looking for information. Also, you never really answered my question. Why are we persisting a module that may never be used again? You state in a previous answer that "...each time you bind this way, it copies the module into your program. So, indeed, they're NOT both bound to the same module -- they are bound to different modules which had been copied from the same source..." If that is the case, then why do you then say in this last response that "In order for 'main' to know that it has to notify 'nomain' to shut down, it would have to know at compile time (not bind time!) that it will eventually be bound to another RPG module, and what that module is called, so that it can insert code to notify it...". Based on what you are saying...it does... otherwise it wouldn't know which instance of the module to use...no? Maybe I'm just a little slow on the uptake, so help me understand this further if you have time. To all - thanks for the education! I think I now understand the HOW's of some of this, but my last question was more of a WHY than anything. It doesn't make sense to persist a 'bound by copy' module that may or may not be used again (unless perhaps you make it a service program with the intent of using it again). It even makes less sense when you find out that each instance is specific to the module to which it is bound. No other modules can use that instance, so again, if the original calling (bound) program ends, why shouldn't the module go away with it? Regards, Dane -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement Sent: Monday, January 10, 2005 5:17 PM To: RPG programming on the AS400 / iSeries Subject: RE: A different kind of persistence? > I had a hunch that's what you'd say, so why then do we persist 'nomain' > modules in the AG after their 'main' module has ended? Who is going to > use it? Because the modules don't know anything about one another. In order for the 'nomain' module to set its "reinitialize everything" flag, it'd have to KNOW that the main module has ended. That would require having the compiler insert code in the main module that notifies it of that fact. In order for 'main' to know that it has to notify 'nomain' to shut down, it would have to know at compile time (not bind time!) that it will eventually be bound to another RPG module, and what that module is called, so that it can insert code to notify it... Seems like a really convoluted way to reinvent the wheel to me. Activation groups can already do this -- and aren't RPG specific. > Are we for some reason assuming that the original 'main' program that > used it will be needed again later, so why clean up after ourselves? > That's an interesting assumption. I'd be interested in hearing any > further thoughts you might have on this. No, it's not an assumption at all. When you activate a program into an activation group, it stays in memory until that activation group is destroyed. And you haven't destroyed it! The system therefore is giving you a choice. You can reclaim the activation group to tell the system that you want to clean everything up, or you can manage the cleaning up on your own. If you choose the later, don't blame the system if something isn't cleaned up. :) -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. NOTICE: This electronic mail message and any files transmitted with it are intended exclusively for the individual or entity to which it is addressed. The message, together with any attachment, may contain confidential and/or privileged information. Any unauthorized review, use, printing, saving, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email and delete all copies.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.