我们可以在这本书中找到一个例子,Ivo Balbaert著:
然而,由于垃圾收集和自动内存分配,Go不适合于实时软件。
是什么使垃圾收集和自动内存分配语言不适合该任务?
发布于 2014-04-23 08:02:44
- In Go and similar languages it is closely tied to garbage collection.
- Many real-time systems want to control their memory allocation as tightly as timings. Some programs don't use dynamic allocation at all. Done right, this means you can write programs that provably never run out of memory.
发布于 2014-04-23 08:00:16
基本上,您无法控制垃圾收集器何时运行或需要多长时间。当然,运行时的设计将使GC尽可能少地占用其他工作。但是“尽可能少”对实时来说是不够的--需要保证在一定的时间内事情会发生。
(内存分配是另一个可能需要“太长”的操作,可能还有其他“内务”任务必须定期运行。但是如果内存分配需要很长的时间,这可能是因为GC需要首先运行。)
https://stackoverflow.com/questions/23238207
复制相似问题