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

Pedram Nimreezi <>
Wed Dec 26 16:35:27 CET 2012


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?



-- 
/* Sincerely
--------------------------------------------------------------
Pedram Nimreezi - Chief Technology Officer  */

// The hardest part of design … is keeping features out. - Donald Norman


More information about the erlang-patches mailing list