interprocess inlining
Ulf Wiger
etxuwig@REDACTED
Thu Dec 5 18:11:21 CET 2002
On Thu, 5 Dec 2002, Shawn Pearce wrote:
>Thomas Lindgren <thomasl_4711@REDACTED> wrote:
>> Third: another interesting issue, if we want to handle
>> more complex scenarios, is how to handle chained
>> sends:
>>
>> - A sends to B
>> - B sends to C
>> - C sends to D
>
>This is the more interesting case to me. Sometimes a
>server is built to just proxy messages to another
>process, after perhaps a very mild reformatting.
>
>If the last meaningful op that a server does is
>a message send, and it doesn't do any function calls
>except the tail recursion to go back to receive,
>it might be nice to inline this just to improve
>latency.
>
>server(State) ->
> receive
> {request, Payload} ->
> Pid = State#mystate.target,
> Pid ! {dowork, Payload, self()},
> server(State)
> end.
Indeed. It could be one of the steps towards really using
lots of simple processes rather than a few complicated ones.
I believe it could make for much more readable code in the
end.
/Uffe
--
Ulf Wiger, Senior Specialist,
/ / / Architecture & Design of Carrier-Class Software
/ / / Strategic Product & System Management
/ / / Ericsson Telecom AB, ATM Multiservice Networks
More information about the erlang-questions
mailing list