<< Okay. Now comes the interesting question: There is no fork() call in IBM
i. How exactly is this "forking" done?>>
The C programming language has a multi-threading library which is why I use
C. I can "fork" a new thread to handle a conversation. <<My opinion only
but I think you have to be crazy to use multi-threading in RPG. Just asking
for it and so incredibly heavy>>

Please note that the same thing can be done in RPG by transferring to a
pre-start job. There are different ways of skinning the same cat. In C, you
fork a new thread to handle the conversation. In RPG, you switch to a
pre-start job.

Pre-start jobs are just a way to start one to many jobs and have them
waiting in a suspended state. They are part of the subsystem description.
The operating system provides function calls that allow me to activate and
switch processing to one of these pre-start jobs. Because the job is
already running, it starts almost instantaneously. All of this stuff is C
api's. If I am programming in C, I use the api directly. If RPG, I have
written service programs that wrap this stuff up.


On Wed, Oct 27, 2021 at 1:55 AM Patrik Schindler <poc@xxxxxxxxxx> wrote:

Hello Alan,

Am 26.10.2021 um 16:06 schrieb Alan Campin <alan0307d@xxxxxxxxx>:

No, that is not how socket servers work. The socket server is just
sitting and listening for connection requests. When it gets one it forks a
new process.

Okay. Now comes the interesting question: There is no fork() call in IBM
i. How exactly is this "forking" done?

That process receives the request and then spawns a new job to do the
processing. That job is a pre-start job so it can start instantaneously.

You mean, it can *run* instantaneously, yes? What are the important bits
of the innards of a PJ program? I did not find information about that yet.
What triggers it to run instead just lingering around activated (by the
SBS?)? What needs to be done to make it go back to
activated-but-finished-with-work state? Especially in hindsight on C being
used.

Thanks!

:wq! PoC

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-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.