NET 4特性聚焦:并行编程
作者: Jonathan Allen 译者: 朱永光
通用语言运行时(Common Language Runtime,CLR)以锁、线程和线程池的形式为并行编程提供基本的支持。不过,随着多核CPU重要性的逐步增加,大家又重燃构建高级并行编程函数库的热情。
很多人现在都投身于函数式编程的世界,由于它们具有不可变的对象,以及与生俱来的线程安全属性。基于F#语言的Haskell和OCaml可以归入此类。其他例如Erlang这样倍受大家偏爱的语言,是基于消息传递和轻量级进程的。除了支持F#外,微软也尝试了几种不同的方式,以需求并行编程的准确提炼。
最先公布的产品是并行LINQ(Parallel LINQ),也即所谓的PLINQ。类似对SQL的处理一样,并行的版本通过语言本身来处理,而无需开发人员的努力。通过把AsParallel附加到查询上,就能正常工作了。不过正如SQL一样,在这里通常还是需要设定很多额外的选项。
下一个出现的是结构化并行性语法(Structured Parallelism),这种技术会让人想起OpenMP。不过它不像OpenMP那样,使用编译器指令标记;微软的解决方案是基于匿名委托。最直观的反应就是代码只需作细微的修改;在“for”语句内的代码块,可以作为参数传递到“Parallel.For”函数中。
如果代码无法轻易地表示为查询或迭代循环,则可以选择任务并行库(Task Parallel Library)。乍看之下,它似乎是另外一种线程池,但它却支持任务之间的父子关系。
为了对应用程序进行更好地控制,微软提供了协调一致的数据结构(Coordination Data Structures)。它们为未来提供了线程安全的集合以及改良过的同步对象。
摘自:InfoQ
XamlPadX 3.0
XAML是类似MXML的一种设计UI的XML语言,主要使用在.Net 3.5中,是WPF中的主要核心部件。微软想通过使用Xaml来实现开发Windows程序的一次重大改进,让UI和代码的分离。设计人员像学习HTML那样学习XAML,然后通过XAML来设计Windows应用程序的UI。而开发人员就在设计人员的UI基础上进行程序撰写。想法非常的不错。
如有兴趣学习和测试XAML,可以使用XAML PadX来进行XAML的简单编辑及预览。
下载地址:http://blogs.msdn.com/llobo/archive/2007/12/19/xamlpadx-v3-0.aspx
具体说明:http://msdn.microsoft.com/en-us/library/ms742398.aspx
XAML的说明:http://msdn.microsoft.com/en-us/library/ms752059.aspx
Mono 1.2.6 发布
微软开发框架的开源版本现在能够在更多现有.NET应用程序上运行.该项目由 Novell支持,允许为Windows框架编写的应用程序在Linux和其它非微软平台上运行.最新版本全面支持.NET 1.1,并部分与.NET 2.0兼容,包括支持Windows Forms.
Mono 按ECMA标准ECMA-335定义的标准执行.NET,ECMA-335指定通用语言基础构架(Common Language Infrastructure)、一个C#编译器和与微软相似的类库,虽然这些并非ECMA标准的工作范围.Mono可在Linux、Mac OS X、Solaris和Windows上运行,并被第三方应用到其它平台上,包括Symbian OS.
新的版本更新包括以下内容:
- Native Windows.Forms driver for MacOS X allows Winforms-based applications to run without an X server.
- Support for the ASP.NET AJAX APIs and controls.
- Support for FastCGI deployments: ASP.NET can now be deployed on a multitude of servers that implement the FastCGI protocol (lighttpd for example) in addition to Apache.
- Windows.Forms now supports the WebControl on Windows and Linux using Mozilla.
- Runtime will now consume much less memory for 2.0-based applications due to various optimizations in generics support as well as including many new performance improvements and an updated verifier and an implementation of CoreCLR security.
- C# compiler is quickly approaching full 3.0 support, most of the basics work right now (except support for System.Query.Expression AST generation).
- Mono 1.2.6 can now be used as an SDK for creating Silverlight 1.1 applications on all platforms. This allows developers to create applications that target Silverlight without requiring a Windows installation.
其实免费的东东也很不错的。点击下载。
Pro C# 2008 and the .NET 3.5 Platform, Fourth Edition (Pro Series)
Apress.Pro.C.Sharp.2008.and.the.dot.NET.3.5.Platform.4th.Edition.Nov.2007.eBook-BBL
书名:Pro C# 2008 and the .NET 3.5 Platform, Fourth Edition (Pro Series)
作者:Andrew Troelsen (Author)
出版社:Apress publisher
ISBN:1590598849
EDITION:4th
出版日期:November 12, 2007
语言:English
下载:emule
Microsoft Visual Studio International Pack 1.0 Beta1
Visual Studio International Pack 包含一组类库,该类库扩展了.NET Framework对全球化软件开发的支持。使用该类库提供的类,.NET 开发人员可以更方便的创建支持多文化多语言的软件应用。 该软件包1.0版提供下面七个组件以增强.NET Framework对全球化软件应用开发的支持。 美中不足还是Beta 1
- East Asia Numeric Formatting Library – 支持将小写的数字字符串格式化成简体中文,繁体中文,日文和韩文的大写数字字符串。
- Japanese Kana Conversion Library – 支持将日文假名(Kana)转化为另一种日文字符。
- Japanese Text Alignment Library – 支持日文特有的一种对齐格式。
- Japanese Yomi Auto-Completion Library – 类库支持感知日文输入法的输入自动完成和一个文本框控制的示例。
- Korean Auto Complete TextBox Control – 在文本框中支持韩文输入法的智能感知和输入自动完成。
- Simplified Chinese Pin-Yin Conversion Library – 支持获取简体中文字符的常用属性比如拼音,多音字,同音字,笔画数。
- Traditional Chinese to Simplified Chinese Conversion Library and Add-In Tool – 支持简繁体中文之间的转换. 该组件还包含一个Visual Studio集成开发环境中的插件(Add-in)支持简繁体中文资源文件之间的转换。
下载:地址
.Net常用工具
This is a must-have for any .NET developer interested in .NET best practices. FxCop will test any .NET assembly against the official Microsoft .NET best-practice coding guidelines.
- Lutz Roeder’s (http://www.aisto.com/roeder/dotnet)
This advanced .NET decompiler/object Reflector for browser allows you to view the .NET implementation of any .NET type using CIL, C#, Object Pascal .NET (Delphi), and Visual Basic .NET.
NAnt is the .NET equivalent of Ant, the popular Java automated build tool. NAnt allows you to define and execute detailed build scripts using an XML-based syntax.
NDoc is a tool that will generate code documentation files for C# code (or a compiled .NET assembly) in a variety of popular formats (MSDN’s *.chm, XML, HTML, Javadoc, and LaTeX).
- NUnit (http://www.nunit.org)
NUnit is the .NET equivalent of the Java-centric JUnit unit testing tool. Using NUnit, you are able to facilitate the testing of your managed code.
- Vil (http://www.1bot.com)
Think of Vil as a friendly “big brother” for .NET developers. This tool will analyze your .NET code and offer various opinions as to how to improve your code via refactoring, structured exception handling, and so forth.
内容选至《Apress C Sharp 2005 and dot Net 2.0 Platform 3rd Edition》
