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



Hello Rich,
If you are using Apache with CGI ( out of the box), then you will have a
similar situation as the ILEastic pearls on a chain if you are using
il_enterThreadSerialize
/ exit.

By default apache uses a single process to handle CGI requests. ( I know
you can set up pools etc).

However with ILEastic you are able to build all the "middleware" in RPG
thereadsafe and tailor your surroundings for your original code.

Also remember that ILEastic gives you "serverless architecture" out of the
box, making it much easier to deploy. Simply restore your library and start
your program.









On Mon, Nov 27, 2023 at 4:25 PM Rick Rauterkus via RPG400-L <
rpg400-l@xxxxxxxxxxxxxxxxxx> wrote:

Thanks for the responses guys, that does clear things up for us. And yes
Scott, I did misspeak on Apache, those are separate jobs. We'll have to
discuss it here, but I'm thinking Apache is the way we will have to go then
so we don't have one call waiting on another.

On Thu, Nov 23, 2023 at 7:54 AM Niels Liisberg <nli@xxxxxxxxxxxxxxxxx>
wrote:

As always - Scott is 100% right!

The construction where you need to call programs that are not
multi-thread aware can also be used as Scott is explaining.

il_enterThreadSerialize();
CLPGM();
il_exitThreadSerialize();

This construction allows you to queue up and execute "normal"
applications
like pearls on a chain.



On Wed, Nov 22, 2023 at 11:37 PM Scott Klement <
rpg400-l@xxxxxxxxxxxxxxxx>
wrote:

Hi Rick,

I'm no expert on ILEastic, but I'm going to guess that
il_enterThreadSerialize and il_exitThreadSerialize would be called when
you want to serialize access to something. For example, suppose you
are calling a CL program that wasn't written in a threadsafe manner,
you
could do:

il_enterThreadSerialize();
CLPGM();
il_exitThreadSerialize();

This would allow only one thread at a time to call CLPGM() (that's what
"serialize" means.) The threads all run concurrently until they get
to
the il_enterThreadSerialize(), but between the enter/exit calls, only
one thread can run. so the others stop and wait for the first thread,
when the first thread is done, the second will run, etc... until all
the
threads have run the code between the enter/exit calls.

With regards to Apache... by default it runs multiple RPG programs in
separate jobs (rather than separate threads.) So there's no need to
worry about threadsafety in this case. If you decided to enable
multi-threaded support that would, of course, change that... at which
point you'd need to code for the threadsafety just as you are doing in
ILEastic.

-SK


On 11/22/23 3:53 PM, Rick Rauterkus via RPG400-L wrote:
I have been playing around with Apache and ILEastic to set up a web
service
that will call a process in our existing application. I have both of
them
working, but have a question on threads.

ILEastic says the RPG programs have to be compiled with
Thread(*Concurrent). I did that with the front end program I created
for
the ILEastic server, but do I need to do that with all the programs
in
the
existing application that could be called by this process also? None
of
the existing programs will use the ILEastic procedures at all. I see
ILEastic includes il_exitThreadSerialize and il_enterThreadSerialize
procedures, but I cannot find anything on how or if they should be
used.

And I guess I have the same concern on going the Apache route too
since
that also uses threads. Is it safe to call existing application
programs
from these web service interfaces without having to modify them?

Thanks for your input! This is new territory for us.

Rick
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related
questions.


--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.


--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



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.