3 ms·
My guess is it can be managed by something similar to the concept of critical sections. That is, GC is disabled in the critical sections and is only enabled exp
by e3b0c 9y ago
My guess is it can be managed by something similar to the concept of critical sections. That is, GC is disabled in the critical sections and is only enabled explicitly by the programmer. That's like how the pauses caused by hardware interrupts are prevented in kernel/driver programming. After all, you won't like heap allocation/deallocation in the hot-path no matter what language is used, be it GCed or not.
- TickleSteve 9y agoThe problem with GC in hard-real-time systems is not speed... real-time != fast. real-time == deterministic, and this is what GC is not. At all times you must know what code is able to execute in order to meet worst-case deadlines. The easiest way of managing this is to disallow any non-deterministic processes in the real-time levels of your application (this means dynamic memory allocation and by inference also GC, but it also applies to anything else). Also bear in mind that most hard-real-time systems are also safety-related and need high-reliability. systems are expected to stay running indefinitely (or at least for years) without a reset on systems with Kilobytes of RAM. For these types of systems you work out your worst-case load and statically allocate everything. This makes it much easier to reason about.
- tuyguntn 9y agoSorry for ignorance, but I always wanted to know what is that real-time systems (other than airplane managing systems) Could you please tell some of them? thanks
- TickleSteve 9y agoQuick list of the top of my head: - Engine management systems (e.g. timing of firing in an IC engine) - Missile detection systems (e.g. need to react to a detection within time to activate countermeasures). - Medical systems (e.g. timing of valve closing/opening is critical to dosage). - Phone protocol stacks (e.g. transmitting during allocated time-slots). - Metering systems (e.g. must read measurement devices at correct time to ensure accuracy). - Audio systems (e.g. avoiding glitches requires deterministic processing) ...and lots, lots more. In general, things that interact with the real physical world require deterministic control.
- pjmlp 9y ago> Missile detection systems (e.g. need to react to a detection within time to activate countermeasures). Nowadays partly written in Real Time Java, can gladly provide examples from military web sites.
- TickleSteve 9y agoThe era that that particular one was written in, java was still accepted in RT systems. These days, that is not the case (I've worked on them myself). They are typically written in C/C++/ADA. Bear in mind that there are typically many levels to something like an ESM system, the lower levels would always be in something like C/C++/ADA (or possibly FPGA) but if Java does come into it, it would be for the UI but even that is more likely C# these days. This is not the RT level code.
- pjmlp 9y agoInteresting, thanks.