Well my challenge is that I am using IBM DB2i Tools from RPGLE using SQL
Functions. So I have no control over java code. I mostly execute DB2i SQL
functions for HTTP requests. Thats why I am trying to keep it within RPG
thread.

Regards



On Thu, Apr 23, 2020 at 12:27 PM Mark Waterbury <
mark.s.waterbury@xxxxxxxxxxxxx> wrote:

Mohammad,

Java is aready inherently multi-threaded, and the JT400 Java Toolbox has
APIs to read from a data queue ... so all you need to do is have the CL
program issue the RUNJVA command to launch one JVM, and then have the Java
code start the desired number of "listener" threads, each using the data
queue APIs of the JT400 class, so they can directly receive the incoming
requests.

And you should now move this discussion thread over to the JAVA400-L list
... :-)

Hope that helps,

Mark S. Waterbury

> On Thursday, April 23, 2020, 1:15:19 PM EDT, Mohammad Tanveer <
surgum@xxxxxxxxx> wrote:

Yes JVM is active. I got it now.

Is there a way to make RPGLE (multi threading)?

My problem is that I have many jobs trying to use java and all of them
starting their own JVM. Starting JVM is taking CPU.

I was thinking to start one job which starts JVM and then rest of the jobs
communicate to that program in separate threads to do java functions. Is
it possible on as/400 using RPGLE?



On Thu, Apr 23, 2020 at 11:57 AM Charles Wilt <charles.wilt@xxxxxxxxx>
wrote:

It would be very unusual for the RPG program to be using multiple
threads...

Much more likely, the RPG program is using Java to do something.

The JVM running in the job probably has all the additional threads.

If you look at the call stack of the threads, you'll likely to see J9
mentioned...
Type Program Statement Procedure

QLESPI QSYS 19
LE_Create_Thread2__FP12crtt >
QP0WPINT QSYS 19 pthread_create_part2

QP2USER2 QSYS 3 __Qp2Thread

QP2USER2 QSYS 5 runpase_common__FiPvT2

P unix *N

P libpthreads.a(shr_xpg > 000000FC _pthread_body

P libj9thr26.so 00000150 thread_wrapper

P libj9gc26.so 00000048 dispatcher_thread_proc

P libj9prt26.so 00000368 j9sig_protect

P libj9gc26.so 00000244
dispatcher_thread_proc2__FP >

Also from WRKJOB, look at option 45-Work with Java Virtual Machine, if
active

Charles

On Thu, Apr 23, 2020 at 9:59 AM Mohammad Tanveer <surgum@xxxxxxxxx>
wrote:

Can someone help me understand Threading on AS/400. I have this job
ITSYNC
it (CL program) reads data from a dataque and process it using RPGLE
program.
I see 83 active threads. Does this mean job can process 83 DTAQ
entries
simultaneously?

Job: ITSYNC User: BATCHORDER Number: 173290


Type options, press Enter.

3=Hold 4=End 5=Display attributes 6=Release 10=Display call
stack

11=Work with thread locks 14=Work with thread mutexes



Total Aux
Run
Opt Thread Name Status CPU I/O
Priority
0000004C DEQW 4.293 5563
30
000000B3 TIMW .021 203
30
000000A9 TIMW .633 34
30
000000A7 TIMW .001 8
30
000000A6 TIMW .002 11
30
000000A5 TIMW .002 10
30
000000A4 TIMW .002 11
30
000000A3 TIMW .002 11
30
000000A2 TIMW .002 13
30
000000A1 TIMW .001 0
30
--
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.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


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

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

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

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
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.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


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.