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




-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Hans Boldt
Sent: Tuesday, May 20, 2003 11:50 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: threading in rpg. was RPG and Web.. (was Using OO concepts
inRPG)


>Of course, then the task is to identify all uses of items in the
>global structures and add mutexes around all of them. Again, time
>consuming for development, as well as slowing down the resulting
>program.

ok.  a threadsafe(*yes *no) hspec handles the run time isssue right?

>I'm not sure how threading can make the *design* of a web
>application any easier. Handling the jumping around from page to
>page is best implemented by maintaining state information for each
>transaction in some persistent store, like a database.

cgi web programming in rpg gets tedious right from the start because you
cant program a simple "prompt the user to enter some information, then
continue running after they click OK" requirement without all the
persistance, reentrant stuff.

In a display file pgm you code:
   FillTheScreen( ... ) ;
   Exfmt PromptRcd ;
   if  *inkc = '1' ;
     return ;
   endif ;
   ProcessTheEntries( ... ) ;

In a cgi web program you cant do this.  As soon as you do the http
equivalent of "exfmt" the state info has to be saved and the job ended.
Then another program, in another job is run when the browser user clicks ok
to send back the entered information.

With threads, it might be possible to start a 2nd thread to handle the http
equivalent of the "exfmt" stmt.  The idea being that the pgm logic thread,
the one that contains the "exfmt" stmt just waits for other threads to deal
with all the disjointed stuff going on as the browser user maybe responds to
the prompt or maybe jumps to another page at your web site.

If it works, this can be done with jobs, but threads will run faster and
using jobs prevents the use of global to all threads variables.

Just an example of how an rpg programmer could use threads.

-Steve



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.