Hi all,
I'm writing some tools for using with HF radio and SDR modems [1], and I'm using multi-threaded architecture. Do you know the status and/or which branch should I use of libosmocore in a multi-threaded application?
Regards, Rafael Diniz
Hi Rafael,
libosmocore master (which will be released over next weeks) should have enough multithread support for most known generic needs. Logging, main loop and as far a I known FSM are prepared to work in a multithreaded environment. In FSM case, you may need to use your own mutex to protect structures. Same goes for CTRL interface. For VTY, it will always happen on the same thread (main thread) handling the socket, so it should be pretty OK.
Some known issues with VTY and logging still exist, but they are really scoped: https://osmocom.org/issues/4088
Remember to avoid using APIs which contain static buffers. Most of them don't make use of static buffers, and for the ones that do then there's usually a _buf() alternative which allows you to pass a stack or heap buffer.
If you find any function in libosmocore using an internal static buffer or finding possible bugs when on multi-thread environment, please open a ticket or send a patch.
Don't hesitate to ping me on IRC or over here if you have more questions about this topic.
Regards, Pau