[erlang-patches] Selectively receive system messages in gen_server and gen_fsm

Fredrik <>
Fri Jan 4 09:08:50 CET 2013

Hello Pedram, must have missed reply to you, your patch has been in the 
'master-pu' branch since wednesday.
Thanks for your contribution,

BR Fredrik Gustafsson
Erlang OTP Team
On 12/26/2012 04:35 PM, Pedram Nimreezi wrote:
> The gen_server and gen_fsm modules do not selectively receive system messages.
> This commit addresses that and allows for them to be consistent with gen_event,
> as well as possibly taking advantage of the recent improvements to
> selective receive.
>          https://github.com/DeadZen/otp/compare/maint...system-selective-receive
>          https://github.com/DeadZen/otp/compare/maint...system-selective-receive.patch
> git fetch git://github.com/DeadZen/otp.git system-selective-receive
> Supplemental Questions...
>    1. I believe, but I am not sure if the selective receive call
> optimization triggers... seems like it should.
>    2. I see that gen_event does do a selective receive, and I believe
> this is more correct.. is that true?
>           https://github.com/DeadZen/otp/blob/maint/lib/stdlib/src/gen_event.erl#L231
>      <- does
>           https://github.com/DeadZen/otp/blob/maint/lib/stdlib/src/gen_fsm.erl#L424
>        <- does not
>           https://github.com/DeadZen/otp/blob/maint/lib/stdlib/src/gen_server.erl#L374
>     <- does not
>    3. Is gen_event a more recent erlang behaviour than gen_server and gen_fsm?

More information about the erlang-patches mailing list