I am working on a very latency sensitive application, and it's at the point where we are trying to get 10s of microseconds of performance improvements out of it. In addition to code optimizations, hardware and OS specific topics have come up, such as processor affinity and interrupt coalescence.
While this is very useful, I've found that these topics come up as tribal knowledge - someone read an article that mentioned a topic, then we do some research into it, and if it feels promising, we finally try implementing it and measure the results. This feels haphazard to me and I am looking for a more regimented approach to learning about these things. The big problem that I face is not knowing what I don't know.
What is a good approach to learning about lower level OS, hardware and networking specific optimizations? Are there specific books or papers that I should read on the topic, or is it more a matter of reading hardware manuals such as this one?
Vendors: work with Intel and AMD for processor optimisations, work with RedHat, SuSe, and Microsoft for OS optimisations, subscribe to various mailing lists for development updates on compiler technologies: Clang, and library dependencies: Glibc, etc.
Want high speed networking? Contact Mellanox, Solarflare, Intel: all are high end vendors and can offer consulting and technology resources for improving development practice and provide insight into future directions.
Related
I'm slowly assembling the picture of how to use FreeRTOS in a real world application.
I've read a lot of partial features (stack supervision, memory, malloc etc...).
But haven't anywhere found a good instruction, what "supervision" to use to be able to follow the performance of tasks, system also after debugger is not connected anymore...
Can anyone help with some pointers, advices?
What features do you activate when a FreeRTOS app is designed?
How do you supervise, what is going on with tasks?
I'd rather read something short, to try feature by feature and see how it works. Something more for beginners. I understand, I have the documentation, but what I'm after is gradual introduction in FreeRTOS with examples. Maybe I overlooked a good info to read...
Let me illustrate it with few questions that I don't have the answers for:
Should I have a separate supervision task, that gathers the info about other tasks (state,memory,..) ?
What features should be used to supervise FreeRTOS based app in an "professional" way?
Should I use ITM/SWO, or maybe RTT?
Do you leave serial console on the system to supervise it?
Thanks in advance,
regards.
I'm slowly assembling the picture of how to use FreeRTOS in a real
world application. I've read a lot of partial features (stack
supervision, memory, malloc etc...). [...]
Can anyone help with some pointers, advices?
On the freeRTOS website, you find a lot of documentation for introduction as well as to understand detail features in depth.
I'd rather read something short, to try feature by feature and see how
it works. Something more for beginners. I understand, I have the
documenation, but what I'm after is gradual introduction in FreeRTOS
with examples. Maybe I overlooked a good info to read...
There is also a lot of third-party documentation. You may want to read general literature about RTOSes and how to use them: First, because many of them refer to one of the most well-known OSS implementation - freeRTOS. Second, because when working with RTOS, one has to take care of virtually the same aspects independent from which RTOS implementation is used.
How do you supervise, what is going on with tasks?
This depends on the purpose of supervision:
If the system that runs the RTOS is critical in some meaning
(e. g., it implements functional safety or
security requirements),
you'll probably need certain supervision measures at runtime that depend on the type and level of criticality.
Violating the expectations of such supervision usually triggers the system to switch off and fall into some kind of safe/secure operation mode.
More usually, you need supervision to debug or trace the application during development and testing to gain insights why certain errors appear in system behaviour, or how long the tasks/ISRs in the system need to execute and how long they are suppressing other contexts in doing so.
This will often allow you to attach a debug/trace adapter to the system all the time.
Violating the expectations here means guiding the developer to a remaining error in the system under development/test.
For many kinds of applications, you may have to measure (and log) the task timings over larger periods in order to get reliable statistics under controlled laboratory (or real-life) conditions.
Then you usually cannot keep a debug/trace adapter dongle at the embedded system because this would disturb the procedures under test. So, a logging concept/implementation is needed.
You have to evaluate the purpose of supervision. Then you can look up this board and others for more specific help and re-post further questions you may have.
But haven't anywhere found a good instruction, what "supervision" to use to be able to follow the performance of tasks, system also after debugger is not connected anymore...
What features do you activate when a FreeRTOS app is designed?
All your application requires (see above). One by one!
Let me illustrate with few questions, that I don't have the answers
for:
Should I have a separate supervision task, that gathers the info about other tasks (state,memory,..)?
What features should be used to supervise FreeRTOS based app in an "professional" way ?
Should I use ITM/SWO, or maybe RTT?
Do you leave serial console on the system to supervise it?
This all depends on the answers you find about the purpose of supervision.
The professional way to deal with it is a top-down approach to focus on the system requirements (and development needs), and to design/implement everything that is necessary to fulfill them.
If you are looking for a way to get a first insight how to activate ITM/SWO trace of freeRTOS for educational purposes, I can recommend the beautiful tutorial in the Atollic blog, a beginners' intro spread over several free articles, step-by-step.
For RTOS architecture hints, you may also like youtube introductions like the channel of beningo engineering, for example.
I'm studying ESP32 for a wifi project, although there are alternatives like CC3200 (TI), because of its price. But I suspect the reliability of ESP32's hardware or SDK.
I found some bugs while developing simple projects. I reported these to ESP but, they just delivered it to the development team, there was no additional response.
I would like to use a big company product like TI, but the price competitiveness of ESP32 is too good.
I would like to hear from those who have developed commercial products with ESP32.
I'm not sure that just saying that because Espressif has shipped 100 Million ESP32 chips is the best answer to the question of whether it is stable enough for implementation in a product. I will say that my company is using it, but the newness of the chip has definitely added some hurdles. However, I do believe it is stable enough for use in products. I'm not sure if you were using the Arduino libraries or the IDF, but my experience with the IDF has been pretty good.
The ESP-IDF v3 (which is currently in pre-release) appears to have added substantial stability as well as opening up new features such as Light Sleep. I would recommend implementing Over The Air updates if you plan on using wifi, just in case though. That way you can update your customers' firmware if you end up finding any bugs later.
Something else to consider is the amount of documentation on the chip and the idf that you'll need. Both are pretty well documented, but I've ocassionaly found myself wishing there were more examples or guides for some function sets. The documentation is definitely improving though, so as time goes on this will get better. Espressif is extremely active on the ESP-IDF GitHub.
Also, the chip has had a couple of silicon revisions, so that may be something you want to look into as well to see if anything revised will hinder you in one version of the chip vs. another.
You can check a lot of this out for yourself in the ESP32 Docs: https://esp-idf.readthedocs.io/en/latest/index.html and ESP-IDF GitHub: https://github.com/espressif/esp-idf
Side-Note: I don't agree that this should be posted in arduino.stackexchange.com at all... Why would the fact that the ESP32 has Arduino wrapper libraries make this specific question only relevant to the Arduino Stackexchange?
This is a good developer question. I would say : Is ESP32 SDK reliable enough to make a "professional" product? Then I would say simply YES. Just because Espressif shipt 100 Million chips in one year. 100 Millions of SDK/application cannot be only lab and DIY buggy IoT... Therefore, the "SDK" Github is very alive...
These frameworks are the future of speed internet. But I can't find any benchmark or feature comparison of them on google. What framework in which situation would be better for example for building highload online shop? For building stackoverflow clone?
Maybe some basic memory management and request handling differences explanation, please?
Though the official documentation links to techempower, ChicagoBoss is not mentioned anywhere. Looking closely at ChicagoBoss it seems to be targeted mostly at Erlang developers, which is not the most popular language out there. I'm a fanatical about Phalcon, but I feel that ChicagoBoss would be faster and more resource efficient out of the box. But… writing your entire app in binary code right away would be even better in that sense.
Phalcon in less than two years achieved bigger popularity and reputation than ChicagoBoss did in five. There is significantly more information and support out there for Phalcon given all standard PHP rules and information apply to it as well. Phalcon next big release is under active development and looks very promising.
What framework in which situation would be better for example for
building highload online shop? For building stackoverflow clone?
I'm certain that neither Amazon or SO use either of them but both rely on a lot of caching and infrastructure optimisation to get where they are – the job for a different type framework.
Phalcon is a great lightweight tool for building unique projects with focus on high performance. It behaves very nicely with PhpStorm and the development / debugging is a pleasure most of the time. But be sure, it will give a lot of headache (there are a few bugs and some information is hard to come by) – isn't the best choice for enterprise software, you will spend a lot of time figuring out how things work and how to fix some of them.
i am studying for a test on operating systems , and i would love it if i can take a look at
free source projects regarding memory management and memory paging.
Thanks very much for your help:)
Nataly
There's plenty of OS kernels with source available, but I have a feeling trying to pick through them is going to be very difficult. A production kernel is a complex piece of work, so it's hard to understand the theory behind it by looking at the code.
What you probably want is an OS simulator that focuses on teaching the theory. We wrote our own in my OS classes. Just a quick google search came up with this list of a number of them:
http://vip.cs.utsa.edu/simulators/
Is VCL dead, or does it have a future as a GUI library? As CLX ended, is there any chance for cross-platform support in future releases?
I've had to do some work with legacy app that uses Borland's VCL(BCB6). Now that new features have to be implemented, it's necessary to revalue alternatives. Whether to stick with VCL or migrate to some other library/framework.
I've never read much what's happening in the field Embarcadero(Borland) tools. At least there seems to be only few VCL tagged questions here in SO and no much luck with google either.
Whether to continue using VCL in your project, or migrate to an alternative depends alot on your requirements. The VCL framework is powerful and mature, with lots of 3rd party components, which makes it a good idea to consider. The alternatives have been improving rapidly, and to point out one as the ultimate choice really requires you to carefully consider your requirements, and validate the strengths and weaknesses of the different frameworks.
Considering that cross platform is on the road map, I remind you that so has 64 bit support been for quite a while. We might see cross platform support, perhaps on schedule, perhaps delayed as we have seen with many previous features. I want to believe its coming because I truly like the VCL framework, but I always have a natural doubt concerning the official road map of the RAD studio series - sorry David. ;)
If you've researched the different alternatives, and found VCL to be the best choice based on its relevance to your project, then I'd consider using the VCL framework, especially if it is a framework you are familiar with. Learning a new framework can - while often a good idea - be a time consuming job. So even though there might be a risk of the framework not being held alive (as will there be with any alternatives) you might save a lot of work staying with the familiar framework, if it is the framework that suits your project the most.
If you do consider going with C++ Builder and the VCL, you might find that the C++ Builder Journal is a valuable source of information, they have a relatively quite forum, but with some interesting posts in it, and some free hints on their website: www.bcbjournal.com.
Of course there is also the embarcadero forums, and this site, it may be a good idea to search the Delphi forums and categories, since it seems there are more active users on these, and by far more posts. One good thing though, is that conversion from Delphi to C++ in VCL related questions is quite simple.
VCL is undergoing continued development.
Cross platform is on the current roadmap.
The embarcadero forums are still a valuable resource.
As a user of VCL I must say that your observations are truly correct. VCL might appeal to you, but the resources available compared to QT and other toolkits is poor at least esp. at SO. Our team have also found several bugs in their components, and have more than once patched components to make our application stable. Still for me the main reason to migrate is that VCL locks you in with a single set of development tools. I must admit that I have a hard time trying to find any really good reasons to continue to use it if you have the resources to migrate.
Given that bcc32 and its libraries is also very buggy, the lockin gets even more serious, The last months me and my team have spent more time fixing issues caused by the compiler than actually developing features. For me this is such a serious impediment that its cost overweight its benefits tenfold. Unfortunately the costs of migrating for us is so high that we at least for now have to endure its pains.