This may be a very close question, but I'm the type who sees what sticks to the wall. With all the benefits of memory and lifecycle management provided by garbage collection time collection, were there any noticeable cases of program uncertainty caused by race conditions between the application and the garbage collector? Has there been a gestalt of defensive programming against this kind of thing? Of course, programmers accustomed to RAII should learn lessons when in the presence of GC.
The problem with garbage collection is that it manages memory resources. Unfortunately, programmers have to manage many, many other types of resources:
to name just a few. To successfully deal with this, you really need the concepts embodied in the RAII idiom.
I think you misunderstand how automatic garbage collection works. Race conditions between the application and a properly implemented garbage collector are impossible, even in principle. The garbage collector collects only those objects that the application cannot access.
Since only one of them can βownβ this object, race conditions cannot occur.
.NET , GC, , , .
, ! , - .Dispose(). ++, ...; -)
++, ! - ? , # 10 , ++. : , . , , .NET(# ++/CLI) 10 , ++ MFC: ++ .
, , .
C, malloc realloc, , . , . ...
, , C, - , . . , ass'd.
Java #. , , , , . , Java Swing ( ), .
, , , GUI , . , . , .
EDIT:
. , . IMO
Source: https://habr.com/ru/post/1704759/More articles:Why doesn't calling my UPDATE query in an Access database via OleDb work? - c #MS Access, Named Parameters and Column Names - .netCan I use GeoServer in a commercial application? - licensingLarge Object Management in C # - memory-managementHow to connect LED indicators in C ++ without a microcontroller? - c ++How can a ViewModel know when data in a service is being updated? - idisposableProcess rdl / rdlc report files without SSRS? - sql-serverDisable warning: you copied a large amount of data to the clipboard - vbaChanging the working folder of an invitation through a python script - pythonVS2008 installation project installing additional dependency files - installationAll Articles