Revolution and Task (handler) Overlap

Gary Dennis gary.dennis at mantissa.com
Fri Feb 8 15:53:01 EST 2002


Please forgive the minutia that follows but I am looking at developing
several high volume application in Revolution that will be based on the
examination of messages received over  multiple TCP/IP connections.  Before
I shoot myself  (and the target application(s)) in the foot so to speak, I
would like to get a few things straight in my mind.

The test case application receives console output from multiple IBM
mainframe systems and filters the console data to call operator attention to
high priority messages.    Because some of these mainframes have up to 800
active tasks the volume can be substantial  (on the order of 5000 messages
per minute).  The average length of  each message is approximately 300
bytes.

One thing I noticed early on is that I could not (even in a  low volume test
environment) let the message handler used to receive the console messages
actually process the message because of the speed with which the messages
could be received and stored.  The environment is Win2k 512 ram, 1gHZ
processor speed.

At this point in the development, all the test case product actually did was
a.) get the message buffer, b.) break the buffer down into lines (crlf
delimited message lines, the lf corresponds to the Rev RETURN, the cr part
of the message is discarded) and c.) place the  message lines AFTER a
scrollable field defined on a card.  After a  line limit is reached (set at
3000 lines), the handler would delete the FIRST line in the field.  I
discovered that in  I was using a replace for the mainframe cr referencing
the entire buffer rather than the last character of each line. Causing the
replace to reference the last character of each line rather than the entire
buffer made some difference but not enough.

Question1.  Is there a mechanism in Rev that causes all messages to be
stacked and executed in sequence as the targer  handler exit is taken for
the previous message?  I had assumed that this is the case.  Is there an
exception to this?  Can you take a message off the message stack for a
handler and requeue it?

What I did was write a small message receive handler that  passed the
message ( via "Send") to the formatting and storage  handler. I am assuming
that the exit of the handler will take place immediately after the READ from
socket function and the handler exit is NOT dependent on the completion of
the read. Question is.....

Question 2.  Does this approach give you any true overlap in the
receive-process cycle?  It appeared to do so.  My assumption is that the
engine is multithreaded in all cases with calls back to the engine providing
the opportunity for handler overlap.

Question 3.  Is there some way to cause Rev to execute one handler at a
higher priority than other handlers?

Question 4. Does the Number of lines function actually examine the content
of the object to make the determination or is the value an attribute of the
object?  In general are there Rev commands that  cause high CPU utilization
when the amount of storage resident data reaches a high level?

Thanks......






More information about the use-livecode mailing list