Are there examples for programming-languages support automatic management of resources besides memory? -


The idea of ​​automated memory management has gained big support with new programming languages. I am interested if there are concepts for automatic management of other resources such as files, network-socket etc.

For single threaded applications, the end of the resource available for the limit of one block of code, at the end With cleanliness, there are many languages ​​present in the examples C ++ is used, or in common Lisp (and equivalent in new Lisp-Impact languages ​​- in Dillon, and in Ruby you pass an object to a block Can).

I 'm not familiar with something better suited to multithrred environments, where modern garbage collection shines, lack of combination of RAI and autogatari reference or auto-IPTR in C ++, which is always trivial

An important difference between the automatic management of resources and automated memory management is that memory management can often be non-deterministic and the process needs to be Occurs only when it is retrieved, while often limited to a resource OS level, so as soon as people are not used, so it should be retrieved. Therefore the option of Smart Pointers instead of garbage collection as a management implementation. An intermediate level of resource - GDI objects, temporary file handles, threads - where an application wants to limit the total amount used to it, but does not care much about releasing other processes - it is often deposited That happens, what you get is towards automatic management.


Comments