A message for data waiting at a socket?
Doug Lerner
doug at webcrossing.com
Sat Jan 3 18:11:37 EST 2004
On 1/4/04 1:53 AM, "Dar Scott" <dsc at swcp.com> wrote:
>
> On Saturday, January 3, 2004, at 07:27 AM, Doug Lerner wrote:
>
>> Never mind my last message - I did get it to "push" according to your
>> suggestion.
>
> But I don't see how that would go into high-CPU consumption.
It didn't. It worked fine. That's why I said never mind my last message. :)
I guess the login in Rev for this is "when it successfully finishes a read
until CRLF send the message on, otherwise let other handlers continue
working and in the meantime nicely share cpu time while I am waiting for
more data."
At any rate, it works fine.
>
> I usually don't use "until <lineEnd>", though I have no argument
> against it. Maybe that changes the behavior. I filter for messages at
> the receive handler.
>
> I do get a high-CPU consumption state when the sender keeps sending
> gobs of data. In a GUI app, this is hard to get out of since pending
> messages normally have higher priority over event messages. I choke
> this two ways. One is to put a delay between the read handler and the
> next read. The other is to detect the situation and shut down the
> connection. (I use other methods for accept.)
OK. A good caution to look out for.
doug
>
> Revolution does "push" at the end of a write, but there might not be a
> way to insist on that kind of thing in other applications.
>
> I'm curious about the high-CPU consumption. If there are cases in
> which it can occur, I'd like to know about them.
>
> Dar Scott
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list