× 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.



Interesting questions.  How does the Mediator address these issues, David?

> -----Original Message-----
> From: Joe Pluta [SMTP:joepluta@PlutaBrothers.com]
> Sent: Thursday, April 11, 2002 3:08 PM
> To:   rpg400-l@midrange.com
> Subject:      RE: Separation of Presentation, BL, and I/O Tiers
>
> > From: Jon Paris
> >
> > Having said all that - given that the routine you call is a
> > generic one used
> > by many different functions, I'm not convinced that dynamic
> > memory is really
> > needed.  Why not just use fixed memory in the callee and map to that.
> Or
> > for that matter use IMPORT/EXPORT.
>
> Whee!  Now you guys are getting into the FUN stuff!
>
> I need to retrieve dynamic amounts of data, data whose size cannot be
> determined at compile time.  Do I allocate the maximum amount of storage,
> or
> dynamically allocate the storage as needed?  Well, that depends on a whole
> bunch of things.
>
> Let's look at static allocation in the callee.  First off, how many of
> these
> modules are you going to have?  If you're talking about creating a nice
> 16MB
> buffer for every file, and you have 100 files, you're talking about 1.6GB
> of
> storage.  For every job.  That's a pretty serious amount of storage.
>
> And what happens when you need to do this recursively?  Let's say you use
> this procedure to handle a bill of materials.  You call the subprogram to
> get the parent's components.  You start processing those records, and the
> first thing you do is go get the components for the first child.  Well,
> since everybody is sharing the same memory (in the callee), then this call
> is going to wipe out the parent's component list.  Life becomes totally
> rancid, dude.
>
> On the other hand, how do you manage dynamic memory?  Do I have a big fat
> buffer that I read everything into, and then allocate a buffer of the
> correct size when I'm done?  Big waste of memory.  Or, I can allocate a
> smaller chunk at a time (say 100 records), and then extend the chunk every
> time I need to.  But this involves copying the old records every time I
> extend the space.  Thirdly, I could allocate space a chunk at a time, and
> then paste them all together at the end.  A nice compromise, but not
> particularly intuitive at first glance.
>
> On top of all this, the caller has to remember to release the data.
> Whether
> the caller does the release or calls the subprogram to do the release,
> this
> is still under the control of the caller.
>
> Whoo hoo!
>
> We're having fun now!
>
> Joe
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.


************************************************************************************************************************************************************************************************************
This message originates from Lincare Holdings Inc. It contains information 
which maybe confidential or privileged and is intended only for the individual 
or entity named above.
It is prohibited for anyone else to disclose, copy, distribute or use the 
contents of this message.
All personal messages express views solely of the sender, which are not to be 
attributed to Lincare Holdings Inc., and may not be copied or distributed 
without this disclaimer.
If you received this message in error, please notify us immediately at 
MailAdmin@lincare.com or (800) 284-2006.
************************************************************************************************************************************************************************************************************



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.