|
hi i had like the same requirements for some cgi, and i use userspace with auto-increment. The iseris part of the consit of stack of call (simulated a green screnn input) with simple screen or subfile, in each pgm i use some of the data gotten from the previous one. After about 20 call to different pgm, i have a full structure (qualified like list api by external DS) an send/receive about 30Ko of data for each transcation. It take about 2 seconds, to make all the process (read stdin, process, write stdout, client process and display) I use 2 userspaces one for work another to store in qtemp so after job done no manage of userspaces to do. The initial idea was, use one pgm for both interactive and batch process. Hope that it can give you an idea. ----- Original Message ----- From: "Larry Ducie" <larry_ducie@xxxxxxxxxxx> To: <rpg400-l@xxxxxxxxxxxx> Sent: Thursday, March 17, 2005 5:42 PM Subject: data pointer vs userspace > Hi, > > I'm writing some code to generate xml data, and it is stored, provisionally, > on a pointer. > > My question is: Which is the best place to hold the data - a pointer within > a userspace or a data pointer within the program? > > I will need to be able to generate data of varying sizes, from 100 bytes to > 100k. However, each instance of the app will generate data of a consistent > size: Instance 1 will generate 100 byte xml (inventory transactions), > instance 2 will generate 32-64k xml (picktickets), etc... > > I know I can allocate up to 16mb of memory to a data pointer, and similar > sizes on a userspace. BUT what scenarios favour one over the other? Which is > fastest to allocate? Which is fastest to reallocate? Which is the most > flexible? Which is the most stable/reliable/resilient? > > I know I can auto-extend a userspace, is this better than %realloc on a data > pointer? I also know I can %realloc less memory to a data pointer, can you > auto-decrease a userspace? Is it actually worthwhile reallocating less > memory to a pointer, or should I only change it upwards? > > Finally, I would not expect the memory I allocate to persist once the job > has finished. > > Again, your wise words are most welcome. > > TIA > > Larry Ducie > > > -- > 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. > >
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.