The Artima Developer Community
Sponsored Link

.NET Buzz Forum
using - It's not just for memory management

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Eric Gunnerson

Posts: 1006
Nickname: ericgu
Registered: Aug, 2003

Eric Gunnerson is a program manager on the Visual C# team
using - It's not just for memory management Posted: Jul 28, 2004 3:26 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Eric Gunnerson.
Original Post: using - It's not just for memory management
Feed Title: Eric Gunnerson's C# Compendium
Feed URL: /msdnerror.htm?aspxerrorpath=/ericgu/Rss.aspx
Feed Description: Eric comments on C#, programming and dotnet in general, and the aerodynamic characteristics of the red-nosed flying squirrel of the Lesser Antilles
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Eric Gunnerson
Latest Posts From Eric Gunnerson's C# Compendium

Advertisement

When we designed the using statement waaaay back in the first version of C#, we decided to call it using because we thought it had other purposes outside of the usual use:

using (StreamWriter writer = File.CreateText(”blah.txt”))
{ ... }

Today I was responding to a customer suggestion, in which he suggested language support for the ReaderWriterLock class, so it could be more like the built-in lock statement. Unfortunately, ReaderWriterLock.AcquireReader() doesn't return something that's IDisposable, but it's pretty easy to add that with a wrapper class.

I spent about 15 minutes writing a wrapper, then I had a thought, did a google search, and came across this article, which already has it done. Plus, the version in the article probably wraps the whole class, and has likely been tested.

Read: using - It's not just for memory management

Topic: .NET Nightly 164 Previous Topic   Next Topic Topic: With things like AOL and other proxies... how useful is IP Address in figuring out duplicate...

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use