osmo_fsm and sub-second timeouts

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Harald Welte laforge at gnumonks.org
Sat May 18 10:55:16 UTC 2019


Hi all!

As some of you know, I'm currently using libosmocore, and specifically
osmo_fsm inside some cortex-m microcontroller projects.  One of the
features I need there:  FSM timeouts below 1s.

osmo_fsm uses osmo_timer_list as underlying timer, and that timer can
express any timeval (seconds + microseconds) as timeout.  Only the osmo_fsm
API doesn't expose that part.

What I could now do: Simply add osmo_fsm_inst_state_chg2 which takes one
more argument for microseconds.  However, I find that "second, microsecond"
style with two arguments everywhere quite clumsy.

So what I'm instead suggesting is to add new API that use one single timeout
value (like the current API), but specify the timeout in milliseconds.  The
old API then becomes a wrapper around the new API, simply multiplyin timeouts
by a factor of 1000.

Does anyone think this is too restrictive?  I currently cannot think of use
cases where timeouts below one 1ms or with granularity below 1ms matter *and*
where one would want to use osmo-fsm. But given how speeds of systems (both
processors and communications systems) are increasing, it might be that we'd
eventually need that?  I'd currently assume osmo_fsm with all of its internal
logging, etc. is too heavy-weight for such super-time-constrained use cases.

And in terms of value range: Assuming a 32bit architecture, the scale of
a 2^32 microsecond value is sufficient to express timeouts up to 1193
hours, which in turn is about 49 days.

Any comments, ideas, thoughts?

Regards,
	Harald
-- 
- Harald Welte <laforge at gnumonks.org>           http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)



More information about the OpenBSC mailing list