× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Mark S. Waterbury wrote:
Just have the service program that contains the procedure that does the %alloc and returns a pointer to the allocated space specify ACTGRP(name) on the CRTSRVPGM command, where "name" could be the same as the name of the *SRVPGM itself.

That way, all of the allocated storage is automatically 'scoped' to the persistent, named activation group (since heaps are always anchored in some activation group), and this storage will not get deallocated until either:

1. your application explicitly issues:

RCLACTGRP ACTGRP(name)

or it reaches end-of-job, which automatically cleans-up all activation groups.

I don't really understand why that's any better. Either way, the consumer of the procedure needs to be aware that the procedure is allocating memory, and act appropriately. Relying on end-of-job cleanup may be fine for batch processes that don't run for too long, but what about "daemon" type jobs (aka never ending programs or NEPs)? What about interactive jobs that may run all day, or even longer?

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.