9 years, 5 months ago.

c++ design pattern or problem

I had a question about something that looked partially problematic to me. First off, is the rtos/ subtree the beginning of the mbed-os we've been hearing announcements for or is it in development? If not, is there anyway to preview any of that work? I'm evaluating this project and the mbed hal to see how much our company could leverage the work ARM is doing.

mbed-rtos / rtos / rtos.h includes a line:

rude

 using namespace rtos;

Isn't this considered bad practice? You are polluting the namespace of any source file/header that includes rtos.h. I don't see what's wrong with leaving that up to a module to do. I suppose alternatively you can just include each sub-module and not use rtos.h at all but then what is the point of that header?

Also in the rtx project there is a lot of re-inventing going on that seems to be uncessary. Is there a non-C89 compliant toolchain that the project is trying to support? If not, why all the U32, BOOL, etc types that seem to be pre stdint.h and stdbool.h problems. How much of this is being cleaned up and are contributions/design criticisms welcome / sought / listened to?

Cheers, Ben

Question relating to:

Official mbed Real Time Operating System based on the RTX implementation of the CMSIS-RTOS API open standard. cmsis, rtos, RTX

2 Answers

9 years, 5 months ago.

Hi Ben - thanks for the questions. Let me try to answer a few of them.

First off, is the rtos/ subtree the beginning of the mbed-os we've been hearing announcements for or is it in development?

No - this is mbed-rtos, a C++ interface to CMSIS-RTOS and at the bottom Keil RTX.

Isn't this considered bad practice? You are polluting the namespace of any source file/header that includes rtos.h.

I'd agree, yes, but if you look at some of mbed's original design principles you might understand why that line is in the implementation. I'd say the API design rightfully implements namespace and design a decision was made to fulfill mbed's principals. https://developer.mbed.org/handbook/Founders-interview

How much of this is being cleaned up and are contributions/design criticisms welcome / sought / listened to? A lot! There are many ways to keep up with mbed development. This site is a great way but focused on using the mbed SDK and tools. There is a mailing list for those developing mbed https://groups.google.com/forum/#!forum/mbed-devel and there is the github account where you can also raise specific questions or issues with an implementation or just contribute and fix :D https://github.com/mbedmicro/mbed

Accepted Answer
9 years, 1 month ago.

An embedded rtos with a C++ interface is such a weird thing. Hopefully it's not the mbed-os.

Elaborate more?

posted by Martin Kojtal 11 Mar 2015