[erlang-questions] binary optimization
Mikael Pettersson
mikpe@REDACTED
Sat Jul 18 14:47:52 CEST 2009
Joel Reymont writes:
> What is a "delayed sub-binary"?
>
> On Jul 18, 2009, at 12:04 PM, Richard Carlsson wrote:
>
> > or you try to rewrite the whole thing so you get a single main loop
> > with
> > direct self-recursive tail calls (if that is at all doable).
>
> Wouldn't the tail call of the loop need to be written as ?MODULE:loop
> to enable code reloading?
Only if you need immediate code upgrading in _this_ loop,
which seems unlikely.
Typically there should be a semi-infinite top-level message
receive/send loop, which calls into short-lived lower-level
worker loops, like your binary parsing thing. Only the top-level
loop should have to care about code upgrades.
More information about the erlang-questions
mailing list