Real-time SystemHow are the real-time features in C# programs?
Windows itself is not a real-time system. In order to achieve real-time features, it is necessary to execute time-critical code in a real-time context (at kernel level).
Due to the fact that in a .NET environment C# can not be executed in real-time, the behvior in time still depends on the Windows scheduler. Thus, it is possible to assign the time-critical C# threads the absolute highest thread priority. Previously this was not possible for programmers. For this reason, Kithara provides the respective mechanisms. At least, the mechanisms can ensure that the application takes priority over all other Windows applications.
For true real-time behavior the essential code should be programmed in C++ and swapped in a DLL file, so that it can be loaded directly in the real-time context.
For communication between application and real-time context shared memory, data or messages pipes, events, or sockets are available. A number of examples projects are included to show how "hard" real-time can be embedded in C# applications.
As long as no other real-time software or similar system-critical software is installed, (almost) nothing exists, which interrupts or delays the real-time task except:
- CLI = general interrupt blocked through Windows and drivers
(unfortunately, no software can do something against it; However, in Windows the blocking time is limited and almost the driver is responsible for this; in this case the respective driver has to be replaced; it is difficult to determine it, thus only possible by our support (in return of payment).
- WBINVD command to flush the entire internal cache
(according to experience, only by using Nvidia graphic drivers; only by replacement of the card with an ATI (AMD) the problem can be solved)
- C1E = Enhanced Power Save Mode of the CPU
(especially, the overdeveloped Intel CPUSs (i7, Xeon, ...) turns into the idle mode after short breaks, so that the wake up after a timer interrupt can take several milliseconds; that can be switched of in the BIOS (see CIE or similar) or the PC is not real-time capable.
Ordinary Windows activities cannot replace real-time task. Windows has the priority 1, whereas the RealTime tasks have the priorities from 1 to 255. DPC has no influence.
To achieve the goal to improve the real-time behavior, only the Dedicated Mode, which supports the exclusive use of single CPU cores in real-time. Without Windows influence the maximum jitter is less than < 1 us.