In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you the "real-time example analysis of the characteristics of C# Windows CE", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and study the "real-time example analysis of the characteristics of C# Windows CE" this article.
The Real-time characteristic of C # Windows CE
One of the design goals of C # Windows CE is to support the development of real-time systems. In embedded programming, real-time refers to the ability to complete specified tasks within a specified period of time, which may be to calculate a value, record an input, or send a command to an external device. Many systems require that no matter how heavy the load, the system should be able to perform such a task (or some tasks) continuously and reliably.
Since C # Windows CE 3.0, the C # Windows CE development team has added a series of features to support the development of real-time systems. This includes support for 256 thread priorities (C # Windows CE has always supported multithreaded programming) and nested interrupt requests. The real-time support of C # Windows CE is defined in the documentation of C # Windows CE Platform Builder as follows:
◆ guarantees an upper limit on the scheduling of high-priority threads, but is only valid for all queued threads with priority *.
◆ guarantees the upper limit of latency when executing a high-priority interrupt service program (ISR,interrupt service routine). Some space is set up in the kernel to temporarily turn off the interrupt service.
◆ ensures control of the scheduler so that it can schedule threads smoothly.
According to the requirements, real-time systems can be divided into two types, one requires hard real-time, the other requires soft real-time. Systems with soft real-time requirements allow some delay without serious consequences, while systems with hard real-time requirements cannot have any delay.
An example of a hard real-time requirement system is a system that controls the movement of a robot arm in a factory. Sometimes it may be necessary to move this arm to keep the production line moving forward, or to allow other machines to work on the production line, but if it is not moved in time, the result may cause the arm, product or part of the production line to be damaged. We assume that such an accident will stop the whole production line, resulting in a great loss of time and cost. )
Although C # Windows CE provides good real-time support, the .NET Compact Framework is not an ideal programming interface for building real-time components. This is because the runtime engine may experience delays at different intervals. For example, there is a delay when using the runtime compile execution (JIT,just-in-time) compiler (described later in this chapter) to load code and compile code to native machine code.
Managed code and unmanaged code
.net Compact Framework code can sometimes be used as managed code, but for application programmers, its most important feature is that data, especially cleared data, is managed by the runtime. Although code can also be managed, you must make sure that there are no incorrect memory pointers. Chapter 3 of this book will focus on this issue.
Conversely, Windows API code can sometimes be used as unmanaged code. This is a .NET-centric approach to the problem, although we sometimes use different terms such as native code and Win32 code to refer to it.
Problems encountered by C # Windows CE, in addition, delays may occur when the garbage collector is working, because all threads running in managed code are frozen, while unmanaged code does not. As a result, the .NET Compact Framework managed code can support real-time threads 16, but in most cases real-time threads are implemented in unmanaged code by calling Win32's DLL. Of course, the above are just some basic principles, if it is a fast CPU, the system load is also very light, threads running in managed code can also provide a fast enough response to meet the requirements of real-time support of the system. For the relationship between timing and performance, we need to "look before you leap" (measure twice and cut once). The number of times to measure the required performance is often proportional to the degree of missing the real-time bottom line.
The above is all the contents of the article "Real-time example Analysis of the characteristics of C # Windows CE". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.