Procedure .R staying in memory

Currently using Progress V9.1B.

I heard that in a previous version of Progress, it was possible to let external procedures in memory the first time it was called.

Exemple :

Mainprog.p :
--------------

.
.
/* 1st time the procedure is called */
/* The procedure 'my_procedure.r' remains in memory when coming back to mainprog.p */
.
RUN c:\my_procedure.r.
.
.
/* 2nd time the procedure is called */
/* the procedure is already in memory, so it must be fatest */
.
RUN c:\my_procedure.r.
.
.
/* 3rd time... */
.
RUN c:\my_procedure.r.
.
.
.



Does anyone has heard of this and how to configure this mode in Progress V9 ?

Cheers.
 

Don Carlson

New Member
Look into "persistent" procedures and see if that will help you. The command would look like:

"RUN myproc.r PERSISTENT SET gv_hMyHandle."

Persistent procedures are nice, but take a little work to implement. You might also want to look into "structured procedure files" as long as you are at it.

If you are interested, I have attached a procedure that you run persistent when your app starts. I actually got it from Progress. Use the following command:

RUN persistentproc.r PERSISTENT SET gv_hPersProc.

It has a function that you can call to see if a procedure is running persistent and if it isn't, it runs it persistent:

gv_hMyHandle = DYNAMIC-FUNCTION('RunPersistent' IN gv_hPersProc, "MyProc.r").

You now have access to all procedures in "MyProc.r" with the following command:

RUN MyProcedure IN gv_hMyHandle (INPUT . . ., OUTPUT . . ).
RUN MyProcedure2 in gv_hMyHandle (INPUT-OUTPUT . . .).
etc.

It's already in memory, so it does make it faster.

Hope this helps.

Don Carlson, Programmer
Computer Software Associates, Inc.
 

Attachments

  • persistentproc.p
    4.1 KB · Views: 12
Hi Don,

It looks very nice and might be very useful is some cases...but my application has more than 300 .w files and 200 .p files and I have no time to change all RUN procedure that it contains.

I was talking about a switch that you can use in your PF file to make, by default, all your called procedure staying in memory (as long as your progress session live).

Thanks anyway for this nice piece of code :)
 

bendaluz2

Member
I think this is what you are looking for

Quick Request (-q) Parameter
UNIX, Windows:
-----------------------------------------------------------
-q
-----------------------------------------------------------
USE WITH: Client Session

In a PROGRESS procedure, when the RUN statement is used to run a subprocedure, PROGRESS searches the directories named by the PROPATH environment variable, looking for a procedure of the same name with a .r file extension. If it finds a file with a .r file extension (an r-code file), it checks to make sure the r-code file has not changed since that r-code file was created.
This search is very useful in a development environment where procedures change regularly and you want to make sure you are always running the most current version of your application. However, in a production environment, you might want to bypass this search.

The Quick Request (-q) parameter tells PROGRESS to search PROPATH directories only on the first use of a procedure. After that, if the procedure still resides in memory or in the local session-compiled file, PROGRESS uses that version of the procedure rather than searching the directories again. However, PROGRESS always checks whether Data Dictionary definitions related to a procedure were modified. If they were modified, PROGRESS displays an error displayed when it tries to retrieve the procedure.

This is valid for version 8, dunno about version 9, try it i guess
 

BONO

Member
We use persistent procedure to share usefull function and procedure since 1 year and i think it's very great. So if u'll use -q think about persistent procedure. You can't change all call on your programs, but you can create some includes and store in it your procedures and then replace procedure code by a call of this include. Do the same thing in the persitent procedure and then u've to maintain on code and you can use persistent call on new programs.
 
Top