您的位置:首页 > 其它

What is new in the .net framework 3.5?

2007-12-13 14:39 721 查看

Collections

HashSet<(Of <(T>)>) provides high performance set operations to the .NET Framework. A set is a collection that contains no duplicate elements, and whose elements are in no particular order. For more information, see HashSet Collection Type.

Diagnostics

The EventSchemaTraceListener class provides tracing of end-to-end, schema-compliant events. You can use end-to-end tracing for a system that has heterogeneous components that cross thread, AppDomain, process, and computer boundaries. A standardized event schema (see Event Representation for Event Consumers) has been defined to enable tracing across these boundaries. This schema is shared by various tracing technologies, including Windows Vista diagnostics tools such as Event Viewer. The schema also enables the addition of custom, schema-compliant elements.

The EventSchemaTraceListener class is tuned for logging performance with implicit support for lock-free tracing.

I/O and Pipes

Pipes provide interprocess communication between any processes running on the same computer, or on any other Windows computer within a network. The .NET Framework provides access to two types of pipes: anonymous pipes and named pipes. For more information about pipes, see Pipes.

Garbage Collection

The GCSettings class has a new LatencyMode property that you can use to adjust the time that the garbage collector intrudes in your application. You set this property to one of the values of the new [System.Runtime.GCLatencyMode] enumeration.

The GC class has a new Collect(Int32, GCCollectionMode) method overload that you can use to adjust the behavior for a forced garbage collection. For example, you can use this overload to specify that the garbage collector should determine whether the current time is optimal to reclaim objects. This overload takes a value from the new GCCollectionMode enumeration.

Reflection and Reflection Emit in Partial Trust

Assemblies that run with partial trust can now emit code and execute it. Emitted code that calls only public types and methods needs no permissions beyond the permissions demanded by the types and methods that are accessed. The new DynamicMethod(String, Type, array<>[]()[]) constructor makes it easy to emit such code.

When emitted code needs to access private data, the new DynamicMethod(String, Type, array<>[]()[], Boolean) constructor allows restricted access. The host must grant ReflectionPermission with the new RestrictedMemberAccess flag to enable this feature, which gives emitted code the ability to access private data only for types and methods in assemblies with equal or lesser trust levels. See Walkthrough: Emitting Code in Partial Trust Scenarios.

For reflection, a host grant of RestrictedMemberAccess similarly allows restricted use of methods that access private properties, call private methods, and so on, but only for target assemblies with equal or lesser trust levels.

Threading

Better Reader/Writer Lock

The new ReaderWriterLockSlim class provides performance that is significantly better than ReaderWriterLock, and comparable with the lock statement (SyncLock in Visual Basic). Transitions between lock states have been simplified to make programming easier and to reduce the chances of deadlocks. The new class supports recursion to simplify migration from lock and from ReaderWriterLock.

ThreadPool Performance Enhancements

Throughput for the dispatch of work items and I/O tasks in the managed thread pool is significantly improved. Dispatch is now handled in managed code, without transitions to unmanaged code and with fewer locks. The use of ThreadPool is recommended over application-specific thread pool implementations.

Time Zone Improvements

Two new types, DateTimeOffset and TimeZoneInfo, improve support for time zones and make it easier to develop applications that work with dates and times in different time zones. For a discussion of which type to use in particular situations, see Choosing Between DateTime, DateTimeOffset, and TimeZoneInfo.

TimeZoneInfo

The new TimeZoneInfo class largely supplants the existing TimeZone class. You can use TimeZoneInfo to retrieve any time zone defined in the registry, rather than just the local time zone and Coordinated Universal Time (UTC). You can also use this class to define custom time zones, to serialize and deserialize custom time zone data, and to convert times between time zones. For more information about developing applications that use the TimeZoneInfo class, see Times and Time Zones.

DateTimeOffset

The new DateTimeOffset structure extends the DateTime structure to make working with times across time zones easier. The DateTimeOffset structure stores date and time information as a UTC date and time together with an offset value that indicates how much the time differs from UTC.
http://msdn2.microsoft.com/en-us/library/bb332048(VS.90).aspx
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: