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



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

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.