× 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 Scott,

This server/worker has been originally written some
time ago and enhanced during these years. Now - apart
from the mysterious crash - is stable and efficient.

The server handles more than 400,000 rqs per day, and
is used to retrieve lists and pdf documents from
optical disks. This retrieval is very fast for recent
documents but can take a lot of time for old ones.
That's why the worker can be busy for 10-15 seconds.
Furthermore, because the client runs on a
internet/intranet browser, very often the impatient
user presses the cancel button and click again on the
document, thus starting another worker !

The dtaq approach - as you pointed out - has some
advantages, but I will try to play with the snd/rcv
method, just in case ...

Giuseppe.

--- Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> ha
scritto:

Hi Beppe,

But I don't understand how the server can know if
there is a worker available or they are all busy
and a
new one should be started and then passed the
request.

Good question.

Personally, I use a spawning server (or INETD) when
I expect to handle
requests that will take a long time. In a
long-running request, the
start-up time is not usually significant, so
pre-starting the workers
isn't much of an issue.

I use pre-started worker jobs only when I expect to
handle requests that
are relatively short, and therefore it's okay to
queue up a few
connection attempts.

I suppose the server could maintain an array of
workers and keep track
of the status of each one. Each time a worker
accepts a new connection,
it notifies the server by sending information via a
socket or pipe.
That give you a scenario very similar to the data
queue you're using
now... the problem with that scenario is it slows
down the speed at
which the server can accept new connections. Which
is why I just use a
spawning server in that scenario, if the accept
speed is going to be
slow ANYWAY, what's the advantage of having a pool
of server jobs?

But, perhaps the data queue approach is the best way
for you, at least
for the time being.


One more question: the worker is in recvmsg.
However
if no request arrives within say 30 minutes, it
should
end. Shall I use alarm to set the timeout ?

alarm() or select(), just like any other socket.
--
This is the RPG programming on the AS400 / iSeries
(RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the
archives
at http://archive.midrange.com/rpg400-l.








___________________________________
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: http://it.docs.yahoo.com/nowyoucan.html

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.