Deterministic Resource Cleanup

Dealing with various kinds of resources is an everyday task for most developers. This ranges from local files to remote databases or web services. To make your application well behaved, it’s often important to release resources as soon as they’re not needed anymore. Whereas the .NET runtime has automatic memory management using the garbage collector, other external resources often don’t. In such cases, cooperation from your code might be needed to properly close such resources.

Get C# 5.0 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.