aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/gen_statem.erl
AgeCommit message (Collapse)Author
2019-02-25Merge branch 'solvip/stdlib/gen_statem/export-start-types'Raimo Niskanen
* solvip/stdlib/gen_statem/export-start-types: Create a gen_statem type for enter_loop options gen_statem exports types related to starting & naming
2019-02-25Create a gen_statem type for enter_loop optionsRaimo Niskanen
2019-01-21correct: Work around a compiler mis-optimizationRaimo Niskanen
This was not a compiler optimization that misfired, rather that the code neede separate case clauses for when the timer was running and not, so to not call erlang:cancel_timer/1 nor maps:remove/2 in the case clause where only a map update was needed before recursion. See the comment in loop_timouts_cancel/13
2019-01-17Write some more comments in the engine loopRaimo Niskanen
2019-01-17Work around a compiler mis-optimizationRaimo Niskanen
The common subexpression optimization accidentally caused unnecessary spilling of live registers. A rather ugly workaround can be found in loop_timeouts_cancel.
2019-01-17Move out helper functions to engine loopRaimo Niskanen
This strategy improves speed benchmarks and reduces the amount of garbage that is produced. More: * Handle transition options as loop function arguments instead of in a record. * Shorten the state_enter loop and make it more efficient by making it more part of the loop and less a loop restart. * Simplify the internal timeout action handling somewhat.
2019-01-15Handle #trans_opts{} fields in parse_actions() argumentsRaimo Niskanen
2019-01-14Optimize gen_statem engine loopRaimo Niskanen
* Use synchronolus cancel_timer since that is more efficient than asynchronous when a process cancels its own timer * Restructure the state to have fewer fields by breaking out practically constant fields into a separate loop argument record #params{}, group state and data into one field and dito for timer fields * Optimize engine loop arguments for staying in the loop so the detour to sys:handle_system_message/6 will require packing/unpacking of the sys: state, and of the argument Parent * Avoid double reverse of event queue in many cases * Restructure the state transition to not have duplicate tracks for sys_debug and non-sys_debug cases * Shortcut the empty list case where possible * Loop unroll reversal of up to 2-element lists to avoid calling lists:reverse/2 since an external call spills all live registers to the stack * Bring out the callback mode check to the engine loop
2018-12-13gen_statem exports types related to starting & namingSölvi Páll Ásgeirsson
Currently, a user of gen_statem cannot use gen_statem types related to naming & starting in their behaviour implementations As an example, we cannot do: -spec start_link(Options) -> gen_statem:start_ret() when Options :: some_complex_thing(). start_link(Options) -> gen_statem:start_link(?MODULE, [Opts], []). As dialyzer, if configured to complain about unknown types, will warn that the type gen_statem:start_ret() is unknown. Likewise, for the same reason, we cannot do: -spec do_call_to_gen_statem(ServerRef) -> Reply when ServerRef :: gen_statem:server_ref(), Reply :: term(). do_call_to_gen_statem(ServerRef) -> gen_statem:call(ServerRef, do_thing). This fixes that by exporting the appropriate types
2018-11-30sys:log timeout 0 eventsRaimo Niskanen
2018-11-30Adjust sys:log(N, get) to documentationRaimo Niskanen
2018-11-30Unify system_events in gen_*Raimo Niskanen
2018-11-30Log code changeRaimo Niskanen
2018-11-30Use from/1 type checkRaimo Niskanen
2018-11-16Limit more error_logger termsRaimo Niskanen
2018-11-16Add client stacktraceRaimo Niskanen
2018-11-16Print sys:log in error reportRaimo Niskanen
2018-09-10Clean up and optimize code and docRaimo Niskanen
2018-06-13Merge branch 'raimo/stdlib/gen_statem-dev/OTP-14015'Raimo Niskanen
* raimo/stdlib/gen_statem-dev/OTP-14015: Show state changes in sys:trace
2018-06-12Show state changes in sys:traceRaimo Niskanen
2018-06-08[logger] Change base OTP domain from [beam,erlang,otp] to [otp]Siri Hansen
2018-05-21Remove logger env vars for format_depth, max_size and utcSiri Hansen
These are replaced by new config handling and must not be used any more.
2018-04-26Start using logger internally in kernel and stdlibSiri Hansen
2018-04-12Fix timeout parsing and doc feedbackRaimo Niskanen
2018-03-22Improve error reasons from state enter callRaimo Niskanen
2018-03-22Merge branch 'maint'Raimo Niskanen
* maint: Updated OTP version Update release notes Update version numbers ssh: Fix bad spec for double_algs() in ssh.hrl Test event insert from init Fix init to allow all actions Conflicts: OTP_VERSION
2018-03-15Fix init to allow all actionsRaimo Niskanen
2018-03-02kernel,stdlib: Remove obsolete use of send with 'noconnect'Sverker Eriksson
as workarounds to avoid blocking auto-connect, which is now asynchronous in OTP-21. Also changed old catch to more efficient try-catch.
2018-02-06stdlib: Do not call erlang:get_stacktrace()Hans Bolinder
2018-01-24Merge branch 'maint'Raimo Niskanen
Conflicts: lib/stdlib/src/gen_statem.erl
2018-01-16Optimize plain call response timeRaimo Niskanen
2017-10-11Merge pull request #1595 from ↵Raimo Niskanen
RaimoNiskanen/raimo/stdlib/gen_statem-clean_timeout-infinity/OTP-13073 Change gen_statem:call(_, _, {clean_timeout,infinity}) to use proxy
2017-10-10Update gen_statem.erlRuan Pienaar
2017-10-09Change {clean_timeout,infinity} to use proxyRaimo Niskanen
2017-09-05stdlib: add Unicode translation modifier in debug format funsSiri Hansen
This is now ok since sys opens the debug file with encoding utf8. Conflicts: lib/stdlib/src/gen_server.erl
2017-09-05stdlib : Improve handling of UnicodeHans Bolinder
2017-05-18stdlib: Limit the size of gen_statem's error eventsHans Bolinder
The postponed events, the user state and data, and the error reason are all limited in error events (if the Kernel variable error_logger_format_depth is set).
2017-05-02Rolled back loop_receive function. HibernateAfterTimeout timeout used even ↵Anton N Ryabkov
in case of active timers exists. Added unit tests for hibernate_after functionality combined with gen_statem timers.
2017-05-02"auto_hibernate_timeout" option renamed to "hibernate_after".Anton N Ryabkov
It was done because "hibernate_after" option already used in ssl for the same reason.
2017-05-02Added support of auto_hibernate_timeout option for gen_statem.Anton N Ryabkov
2017-04-21Implement {timeout,Name} timeoutsRaimo Niskanen
2017-04-20Implement erlang:start_timer optsRaimo Niskanen
2017-04-20Make Module:init/1 mandatoryRaimo Niskanen
2017-02-23Make code_change/4 optionalRaimo Niskanen
2017-02-23Implement fallback for terminate/3Raimo Niskanen
2017-02-22Stop pampering with stacktracesRaimo Niskanen
2017-02-22Clean up timer handlingRaimo Niskanen
2017-02-07Remove event timer optimizationRaimo Niskanen
Handle the event timer more like other timers and do not optimize the odd case of combining an event timeout with inserting custom events, wich by definition cancels the event timeout.
2017-02-07Clean up timer handlingRaimo Niskanen
2017-02-03Reduce number of loop variables hence code massRaimo Niskanen