Exclusive PC World tests show that PCs equipped with Intel's new Core 2 Duo processors, formerly code-named Conroe, set new high marks for desktop performance--they're the fastest we've seen by far.
With this chip line, which formally launched on July 27, Intel decisively reclaims the power desktop crown from competitor AMD.
AMD recently introduced aggressive price cuts, lowering the cost of its Athlon 64 FX-62 from $1031 to $827, while mainstream chips like the 2.4-GHz Athlon 64 X2 4600+ dropped from $558 to $240. In response, Intel also lowered the prices of older desktop processors.
Testing, Testing
In our WorldBench 5 test suite, Intel's Core 2 Duo reference system outscored a matching system equipped with AMD's high-end Athlon 64 FX-62 chip by 17 percent. We also tested shipping PCs based on several chips in the Core 2 Duo family, including a water-cooled, overclocked ABS machine that posted a mark of 181 on our WorldBench 5 test--the highest WorldBench score we've ever seen. (See PC World's detailed test results and chart. For full reviews of five new Core 2 Duo-based systems, click the product names in the results chart.)
All of our Core 2 Duo configurations performed impressively, and the higher-end models in particular should allow power users to handle demanding multimedia work on their PCs more quickly and to perform multiple computing tasks at once more efficiently. Gaming, too, will receive an impressive boost from systems equipped with the new chips.
Though its new products are good news for users, things are different for some Intel employees, as the company announced the layoff of 1000 management employees.
The Core 2 Duo Line
The Core 2 Duo processor line ranges from the 1.86-GHz E6300 chip ($183) with 2MB of cache to the 2.93-GHz Core 2 Extreme X6800 chip ($999) with 4MB of cache; all have a 1066-MHz system bus. (Intel leaves the "Duo" designation off of its X6800 CPU.)
Though Core 2 Duo chips use the same Socket 775 interface as current Pentium 4 and Pentium D chips, they require new chip sets, so you'll have to get a new motherboard--you can't just pop a Core 2 Duo chip into your existing Intel-based PC and reap the tremendous performance gains. The Core 2 Duo reference systems we tested used a motherboard with Intel's 975X Express chip set (boards using the P965 Express chip set will also be available); nVidia and ATI have their own Core 2 Duo boards as well.
The new processors and systems will be on sale from various vendors beginning July 27, with some configurations of Core 2 Duo machines checking in at surprisingly reasonable prices.
Thursday, September 20, 2007
Intel's New Core 2 Duo Processors Run Blazingly Fast in PC World Tests
Posted by Ankit at 7:22 AM 0 comments
Saturday, August 18, 2007
Intel Core 2 Duo : Additional Info
"The Core 2 Duo processors are simply the best processors in the world," said Paul Otellini, president and CEO of Intel. "Not since Intel introduced the Pentium® processor has the industry seen the heart of the computer reinvented like this. The Core 2 Duo desktop processor is an energy-efficient marvel, packing 291 million transistors yet consuming 40 percent lower power, while delivering the performance needed for the applications of today and tomorrow."
The highly anticipated processor family already has very broad support with more than 550 customer system designs underway—the most in Intel's history. Ultimately, tens of thousands of businesses will sell computers or components based on these processors.
The Intel Core 2 Duo processors are built in several of the world's most advanced, high-volume output manufacturing facilities using Intel's leading 65-nanometer silicon process technology. The desktop PC version of the processors also provide up to a 40 percent increase in performance and are more than 40 percent more energy efficient versus Intel's previous best processor. According to multiple independent review organizations, the processors win more than nine out of 10 major server, desktop PC and gaming PC performance benchmarks.
The Intel Core 2 Duo processor family consists of five desktop PC processors tailored for business, home, and enthusiast users, such as high-end gamers, and five mobile PC processors designed to fit the needs of a mobile lifestyle. Intel Core 2 Duo processor-based workstations will also deliver industry leading performance for such areas as design, content creation and technical computing.
The processor family is based on the revolutionary Intel® Core™ microarchitecture, designed to provide powerful yet energy-efficient performance. With the power of dual cores, or computing engines, the processors can manage numerous tasks faster. They also can operate more smoothly when multiple applications are running, such as writing e-mails while downloading music or videos and conducting a virus scan. These dual-core chips also improve tasks, such as viewing and playing high-definition video, protecting the PC and its assets during e-commerce transactions, and enabling improved battery life for sleeker, lighter notebooks.
Consumers and businesses will have the option to purchase Intel Core 2 Duo processors as part of Intel's premier market-focused platforms, which are made up of Intel hardware and software technologies tailored to specific computing needs, including Intel® vPro™ technology for businesses, Intel® Centrino® Duo mobile technology for laptops, and Intel® Viiv™ technology for the home.
Many of the products will also offer a selection of Intel-designed and integrated technologies such as Intel® Virtualization Technology and Intel® Active Management Technology that make the PC more secure and manageable. Also, support for 64-bit computing now expands to notebook PCs. The new processors can be paired with the Intel® 975X, 965, and Mobile Intel® 945 Express chipset family. The Intel 965 Express chipset includes the latest integrated graphics and Intel® Clear Video Technology. All these chipsets are Microsoft Windows Vista* Premium Ready.
Advanced InnovationsIntel Core 2 Duo and Intel® Core™2 Extreme processors include many advanced innovations, including:
Intel® Wide Dynamic Execution – Improves performance and efficiency as each core can complete up to four full instructions simultaneously using an efficient 14-stage pipeline.
Intel® Smart Memory Access – Improves system performance by hiding memory latency, thus optimizing the use of available computer data bandwidth to provide data to the processor when and where it is needed.
Intel® Advanced Smart Cache – Includes a shared L2 cache or memory reservoir to reduce power by minimizing memory "traffic" yet increases performance by allowing one core to utilize the entire cache when the other core is idle. Only Intel provides this capability in all segments.
Intel® Advanced Digital Media Boost – Effectively doubles the execution speed for instructions used widely in multimedia and graphics applications.
Intel® 64 Technology – This enhancement to Intel's 32-bit architecture supports 64-bit computing, including enabling the processor to access larger amounts of memory.
Mobile PC Processor Unique FeaturesIntel Core 2 Duo mobile processors include many advanced innovations, including:
Intel® Dynamic Power Coordination – Coordinates Enhanced Intel SpeedStep® Technology and idle power-management state (C-states) transitions independently per core to help save power.
Intel® Dynamic Bus Parking – Enables platform power savings and improved battery life by allowing the chipset to power down with the processor in low-frequency mode.
Enhanced Intel® Deeper Sleep with Dynamic Cache Sizing – Saves power by flushing cache data to system memory during periods of inactivity to lower CPU voltage.
Pricing and AvailabilityIntel has been shipping production-ready Intel Core 2 Duo processors for all segments in advance of today's unveiling. Initial Intel Core 2 Extreme processor-based systems are now available from system manufacturers, resellers and integrators, including Intel Channel Partner Program members. Intel Core 2 Duo desktop processor-based systems will be available beginning in early August. Intel Core 2 Duo processor-based notebooks will be available at the end of August.
Desktop Processors
Processor
Frequency
Bus Speed
L2 Cache
Price
Intel® Core™2 Extreme processor X6800
2.93 GHz
1066
4MB
$999
Intel® Core™2 Duo processor E6700
2.66 GHz
1066
4MB
$530
Intel® Core™2 Duo processor E6600
2.40 GHz
1066
4MB
$316
Intel® Core™2 Duo processor E6400
2.13 GHz
1066
2MB
$224
Intel® Core™2 Duo processor E6300
1.86 GHz
1066
2MB
$183
Mobile Processors
Processor
Frequency
Bus Speed
L2 Cache
Voltage
Intel® Core™2 Duo processor T7600
2.33 GHz
667
4MB
1.0375–1.3V
Intel® Core™2 Duo processor T7400
2.16 GHz
667
4MB
1.0375–1.3V
Intel® Core™2 Duo processor T7200
2.00 GHz
667
4MB
1.0375–1.3V
Intel® Core™2 Duo processor T5600
1.83 GHz
667
2MB
1.0375–1.3V
Intel® Core™2 Duo processor T5500
1.66 GHz
667
2MB
1.0375–1.3V
Posted by Ankit at 9:11 PM 0 comments
Saturday, August 4, 2007
Intel Core 2 Duo Processor
The Intel® Core™ Duo processor breaks new ground. Its dual-core technology rewrites the rules of computing, delivering optimized power efficient computing and breakthrough dual-core performance with amazingly low power consumption. Intel Core Duo processor is available in Intel's premium laptop platform, Intel® Centrino® Duo mobile technology+. It can also be found in select Intel® Viiv™ technology-based systems∇.
Features and benefits
Outstanding dual-core performance
With its two execution cores, the Intel Core Duo processor is optimized for multi-threaded applications and multitasking. You can simultaneously run multiple demanding applications such as graphics-intensive games or serious number-crunching programs - while downloading music or running virus-scanning security programs in the background.
Power efficiency
Demand for greater power efficiency in computing is on the rise from desktop to laptop PCs. With an Intel Core Duo processor, you get a balance of great dual-core computing capabilities and power savings. Its enhanced voltage efficiency supports cooler and quieter system designs as compared to traditional desktop and laptop PCs. And thanks to the innovative energy efficient technologies built-in, the Intel® Core™ Duo processor is able to transfer power only to those areas of the processor that need it, thereby enabling laptops to save power and desktops to have thinner, sleeker designs.
A vibrant media experience
The Intel Core Duo processor enables your Intel Viiv technology and Intel Centrino Duo mobile technology multimedia experience to be all the more vibrant. Featuring Intel® Digital Media Boost, the Intel® Core™ Duo processor enables accelerating technologies for applications such as CAD tools, 3D and 2D modeling, video editing, digital music, digital photography and gaming. This is one of the key ingredients that help Intel Viiv technology and Intel Centrino Duo mobile technology to give you a truly rich multimedia experience.
Smarter, more efficient designs
The Intel Core Duo processor features Intel® Smart Cache which helps deliver a smarter and more efficient cache and bus design to enable enhanced dual-core performance, and power savings.
An essential ingredient in Intel® Centrino® Duo mobile technology
The Intel® Core™ Duo processor is Intel's first mobile dual-core processor and a key component of the new Intel Centrino Duo mobile technology platform.
Related links
Experience revolutionary mobile performance with Intel® Centrino® Duo mobile technology
Immerse yourself in powerful digital home entertainment with Intel® Viiv™ technology
Compare products
Compare Intel® Centrino® Mobile Technology features
Motherboard and Barebones Selector Guide
Compare Intel® chipsets
2006 PC WorldWorld Class Award
PC World World Class Award" height=79 alt="2006 PC World World Class Award" src="http://www.intel.com/products/processor/coreduo/pix/pcworld.jpg" width=50>
July 2006
Intel® Core™ Duo processor named Product of the Year by PC World.
View article ›
Intel® Centrino® Duo mobile technology
Take a thrilling leap in mobility and do more of the things you love where and when you want with Intel® Centrino® Duo mobile technology.
Learn more ›
Intel® Viiv™ technology
Enjoy music, movies, photos, games, and online services and software in your home with more control than ever before.
Learn more ›
Products in action
Personal
Your Mobile Lifestyle
Mobile Entertainment
Gaming
Professional
Small Business
+ System performance, battery life, high-definition quality and functionality, and wireless performance and functionality will vary depending on your specific operating system, hardware and software configurations. References to enhanced performance including wireless as measured by SYSmark* 2004 SE, PCMark*05, 3DMark*05, 3DMark*06, SPEC* CPU2000* and Adjacent Channel Interference (ACI)* refer to comparisons with previous generation Intel® Centrino® processor technology platforms. References to improved battery life as measured by MobileMark* 2005, if applicable, refer to previous generation Intel Centrino processor technology platforms. Wireless connectivity and some features may require you to purchase additional software, services or external hardware. Availability of public wireless LAN access points is limited, wireless functionality may vary by country and some hotspots may not support Linux-based Intel Centrino processor technology systems. See www.intel.com/products/centrino/ for more information. SPEC, SPECint, SPECfp, SPECrate, SPECweb, SPECjbb are trademarks of the Standard Performance Evaluation Corporation. See: http://www.spec.org for more information on the benchmarks.
∇ Verified services will vary, and content restrictions may apply. Wireless and network performance varies with specific hardware and software configurations, usage, and environmental interference. Use a wired connection for improved performance with video and other media. May require TV tuner card and/or remote which may be sold separately. Instant on/off feature works after initial boot, when activated. See www.intel.com/go/viiv_info for more information.
Posted by Ankit at 1:45 PM 0 comments
Sunday, July 22, 2007
Windows Vista
Windows Vista is a line of graphical operating systems used on personal computers, including home and business desktops, notebook computers, Tablet PCs, and media centers. Prior to its announcement on July 22, 2005, Windows Vista was known by its codename "Longhorn".[1] Development was completed on November 8, 2006; over the following three months it was released in stages to computer hardware and software manufacturers, business customers, and retail channels. On January 30, 2007, it was released worldwide to the general public,[2] and was made available for purchase and downloading from Microsoft's web site.[3] The release of Windows Vista comes more than five years after the introduction of its predecessor, Windows XP, making it the longest time span between two releases of Microsoft Windows.
Windows Vista contains hundreds of new and reworked features; some of the most significant include an updated graphical user interface and visual style dubbed Windows Aero, improved searching features, new multimedia creation tools such as Windows DVD Maker, and completely redesigned networking, audio, print, and display sub-systems. Vista also aims to increase the level of communication between machines on a home network using peer-to-peer technology, making it easier to share files and digital media between computers and devices. For developers, Vista includes version 3.0 of the .NET Framework, which aims to make it significantly easier for developers to write high-quality applications than with the traditional Windows API.
Microsoft's primary stated objective with Windows Vista, however, has been to improve the state of security in the Windows operating system.[4] One common criticism of Windows XP and its predecessors has been their commonly exploited security vulnerabilities and overall susceptibility to malware, viruses and buffer overflows. In light of this, Microsoft chairman Bill Gates announced in early 2002 a company-wide 'Trustworthy Computing initiative' which aims to incorporate security work into every aspect of software development at the company. Microsoft stated that it prioritized improving the security of Windows XP and Windows Server 2003 above finishing Windows Vista, thus delaying its completion.[5]
Windows Vista has been the target of a number of negative assessments by various groups. Criticism of Windows Vista has included protracted development time, more restrictive licensing terms, the inclusion of a number of new Digital Rights Management technologies aimed at restricting the copying of protected digital media, and the usability of other new features such as User Account Control.
Contents [hide]
1 Development
2 New or improved features
2.1 End-user features
2.2 Core technologies
2.3 Security-related technologies
2.4 Business technologies
2.5 Developer technologies
2.6 Welcome Center
3 Deprecated features
4 Editions and pricing
5 Visual styles
6 Hardware requirements
7 Service Pack 1
8 Criticism
9 See also
10 Notes and references
11 External links
11.1 Microsoft
11.2 Reviews and screenshots
11.3 Criticism
11.4 Security vulnerabilities
Development
The Windows Vista Codename (Longhorn) logo
Windows Orb logo, also used as the "Start" button.Main article: Development of Windows Vista
Microsoft started work on their plans for Windows Vista ("Longhorn") in 2001,[6] prior to the release of Windows XP. It was originally expected to ship sometime late in 2003 as a minor step between Windows XP (codenamed "Whistler") and "Blackcomb" (now known as Windows "Vienna"). Gradually, "Longhorn" assimilated many of the important new features and technologies slated for "Blackcomb", resulting in the release date being pushed back several times. Many of Microsoft's developers were also re-tasked with improving the security of Windows XP.[5] Faced with ongoing delays and concerns about feature creep, Microsoft announced on August 27, 2004 that it was making changes. The original "Longhorn", based on the Windows XP source code, was scrapped, and Vista development started anew, building on the Windows Server 2003 codebase, and re-incorporating only the features that would be intended for an actual operating system release. Some previously announced features such as WinFS were dropped or postponed, and a new software development methodology called the "Security Development Lifecycle" was incorporated in an effort to address concerns with the security of the Windows codebase.[7]
After "Longhorn" was named Windows Vista, an unprecedented beta-test program was started, involving hundreds of thousands of volunteers and companies. In September 2005, Microsoft started releasing regular Community Technology Previews (CTP) to beta testers. The first of these was distributed among 2005 Microsoft Professional Developers Conference attendees, and was subsequently released to Microsoft Beta testers and Microsoft Developer Network subscribers. The builds that followed incorporated most of the planned features for the final product, as well as a number of changes to the user interface, based largely on feedback from beta testers. Windows Vista was deemed feature-complete with the release of the "February CTP", released on February 22, 2006, and much of the remainder of work between that build and the final release of the product focused on stability, performance, application and driver compatibility, and documentation. Beta 2, released in late May, was the first build to be made available to the general public through Microsoft's Customer Preview Program. It was downloaded by over five million people. Two release candidates followed in September and October, both of which were made available to a large number of users.
While Microsoft had originally hoped to have the operating system available worldwide in time for Christmas 2006, it was announced in March 2006 that the release date would be pushed back to January 2007, in order to give the company – and the hardware and software companies which Microsoft depends on for providing device drivers – additional time to prepare. Through much of 2006, analysts and bloggers had speculated that Windows Vista would be delayed further, owing to anti-trust concerns raised by the European Commission and South Korea, and due to a perceived lack of progress with the beta releases. However, with the November 8, 2006 announcement of the completion of Windows Vista, Microsoft's lengthiest operating system development project came to an end.
New or improved features
Main article: Features new to Windows Vista
End-user features
The appearance of Windows Explorer has changed since Windows XP.Windows Aero: The new hardware-based graphical user interface, named Windows Aero – an acronym for Authentic, Energetic, Reflective, and Open. The new interface is intended to be cleaner and more aesthetically pleasing than those of previous Windows, including new transparencies, live thumbnails, live icons, animations and eye candy.
Windows Shell: The new Windows shell is significantly different from Windows XP, offering a new range of organization, navigation, and search capabilities. Windows Explorer's task panel has been removed, integrating the relevant task options into the toolbar. A "Favorite links" panel has been added, enabling one-click access to common directories. The address bar has been replaced with a breadcrumb navigation system. The preview panel allows users to see thumbnails of various files and view the contents of documents. The details panel shows information such as file size and type, and allows viewing and editing of embedded tags in supported file formats. The Start menu has changed as well; it no longer uses ever-expanding boxes when navigating through Programs. The word "Start" itself has been removed in favor of a blue Windows Orb (also called "Pearl").
Instant Search (also known as search as you type): Windows Vista features a new way of searching called Instant Search, which is significantly faster and in-depth(content-based) than that of the search features found in any of the previous versions of Windows.[8]
Windows Sidebar: A transparent panel anchored to the side of the screen where a user can place Desktop Gadgets, which are small applets designed for a specialized purpose (such as displaying the weather or sports scores). Gadgets can also be placed on other parts of the desktop.
Windows Internet Explorer 7: New user interface, tabbed browsing, RSS, a search box, improved printing,[9] Page Zoom, Quick Tabs (thumbnails of all open tabs), Anti-Phishing filter, a number of new security protection features, Internationalized Domain Name support (IDN), and improved web standards support. IE7 in Windows Vista runs in isolation from other applications in the operating system (protected mode); exploits and malicious software are restricted from writing to any location beyond Temporary Internet Files without explicit user consent.
Windows Media Player 11Windows Media Player 11, a major revamp of Microsoft's program for playing and organizing music and video. New features in this version include word wheeling (or "search as you type"), a new GUI for the media library, photo display and organization, the ability to share music libraries over a network with other Vista machines, Xbox 360 integration, and support for other Media Center Extenders.
Backup and Restore Center: Includes a backup and restore application that gives users the ability to schedule periodic backups of files on their computer, as well as recovery from previous backups. Backups are incremental, storing only the changes each time, minimizing the disk usage. It also features Complete PC Backup (available only in Ultimate, Business, and Enterprise versions) which backs up an entire computer as an image onto a hard disk or DVD. Complete PC Backup can automatically recreate a machine setup onto new hardware or hard disk in case of any hardware failures. Complete PC Restore can be initiated from within Windows Vista, or from the Windows Vista installation CD in the event the PC is so corrupt that it cannot start up normally from the hard disk.
Windows Mail: A replacement for Outlook Express that includes a new mail store that improves stability,[10] and features integrated Instant Search. It has the Phishing Filter like IE7 and a Junk mail filtering which is enhanced through regular updates via Windows Update.[11]
Windows Calendar is a new calendar and task application.
Windows Photo Gallery, a photo and movie library management application. WPG can import from digital cameras, tag and rate individual items, adjust colors and exposure, create and display slideshows (with pan and fade effects), and burn slideshows to DVD.
Windows DVD Maker, a companion program to Windows Movie Maker, which provides the ability to create video DVDs based on a user's content. Users can design a DVD with title, menu, video, soundtrack, pan and zoom motion effects on pictures or slides, in minutes.
Windows Media Center, which was previously exclusively bundled as a separate version of Windows XP, known as Windows XP Media Center Edition, has been incorporated into the Home Premium and Ultimate editions of Windows Vista.
Games and Games Explorer: Games included with Windows have been modified to showcase Vista's graphics capabilities. New games are Chess Titans, Mahjong Titans and Purble Place. A new Games Explorer special folder holds shortcuts and information to all games on the user's computer.
Windows Mobility Center.Windows Mobility Center is a control panel that centralizes the most relevant information related to mobile computing (brightness, sound, battery level / power scheme selection, wireless network, screen orientation, presentation settings, etc.).
Windows Meeting Space replaces NetMeeting. Users can share applications (or their entire desktop) with other users on the local network, or over the Internet using peer-to-peer technology (higher versions than Starter and Home Basic can take advantage of hosting capabilities, limiting previous to "join" mode only)
Shadow Copy automatically creates daily backup copies of files and folders. Users can also create "shadow copies" by setting a System Protection Point using the System Protection tab in the System control panel. The user can be presented multiple versions of a file throughout a limited history and be allowed to restore, delete, or copy those versions. This feature is available only in the Business, Enterprise, and Ultimate editions of Windows Vista and is inherited from Windows Server 2003.[12]
Windows Update with Windows Ultimate ExtrasWindows Update: Software and security updates have been simplified,[13] now operating solely via a control panel instead of as a web application. Windows Mail's spam filter and Windows Defender's definitions are updated automatically via Windows Update. Users that choose the recommended setting for Automatic Updates will have the latest drivers installed and available when they add a new device.
Parental controls: Allows administrators to control which websites, programs, and games each standard user can use and install. This feature is available in Home Premium and Ultimate versions of Vista.
Windows SideShow: Enables the auxiliary displays on newer laptops or on supported Windows Mobile devices. It is meant to be used to display device gadgets while the computer is on or off.
Speech recognition is integrated into Vista.[14] It features a redesigned user interface and configurable command-and-control commands. Unlike the Office 2003 version, which works only in Office and WordPad, Speech Recognition in Windows Vista works for any accessible application. In addition, it currently supports several languages: British and American English, Spanish, French, German, Chinese (Traditional and Simplified), and Japanese.
New fonts, including several designed for screen reading, and improved Chinese (Yahei, JhengHei), Japanese (Meiryo) and Korean (Malgun) fonts. See Windows Vista typefaces. ClearType has also been enhanced and enabled by default.
Problem Reports and Solutions, a control panel which allows users to view previously sent problems and any solutions or additional information that is available.
Improved audio controls allow the system-wide volume or volume of individual audio devices and even individual applications to be controlled separately. New audio functionalities such as Room Correction, Bass Management, Speaker Fill and Headphone virtualization have also been incorporated.
System Performance Assessment is a tool used to benchmark system performance. Software such as games can retrieve this rating and modify its own behavior at runtime to improve performance. The benchmark tests CPU, RAM, 2-D and 3-D graphics acceleration, Graphics Memory and Hard disk space.[15][16]
Windows Ultimate Extras: The Ultimate Edition of Windows Vista provides access to extra games and tools, available through Windows Update. This replaces the Microsoft Plus! software bundle that was sold alongside prior versions of Windows.
Built-in hard drive partition management: A utility to modify hard disk drive partitions, including shrinking, creating and formatting new partitions.
Performance Diagnostic Console includes various tools for tuning and monitoring system performance and resources activities of CPU, disks, network, memory and other resources. It shows the operations on files, the opened connections, etc.
Core technologies
Main article: Technical features new to Windows Vista
Windows Vista is intended to be a technology-based release, to provide a solid base to include technologies, many of which will be related to how the system functions, and hence not readily visible to the user. An example of this is the restructuring of the architecture of the audio, print, display, and networking subsystems; while the results of this work will be visible to software developers, end-users will only see what appear to be evolutionary changes in the user interface.
Vista includes technologies such as ReadyBoost and ReadyDrive which employ fast flash memory (located on USB drives and hybrid hard disk drives respectively) to improve system performance by caching commonly-used programs and data. This manifests itself in improved battery life on notebook computers as well, since a hybrid drive can use the Flash memory to cache the data currently in use by the OS and/or other applications, spinning down the disc platters till some fresh data is required. Another new technology called SuperFetch utilizes machine learning techniques to analyze usage patterns in order to allow Windows Vista to make decisions about what application and content should be present in system memory at any given time.
As part of the redesign of the networking architecture, IPv6 has been incorporated into the operating system, and a number of performance improvements have been introduced, such as TCP window scaling. Windows Vista includes more comprehensive support for wireless networking, compared with previous versions of Windows.
For graphics, Vista introduces a new Windows Display Driver Model (WDDM), as well as major revisions to Direct3D. The new driver model facilitates the new Desktop Window Manager, which provides the tearing-free desktop and special effects that are the cornerstones of Windows Aero. WDDM's current version 1.0 is able to offload rudimentary tasks to the GPU, install drivers without requiring a system reboot and seamlessly recover from rare driver errors due to illegal application behavior. The next version is going to require an entirely new generation of GPUs, which NVIDIA and ATI are working on. Direct3D 10, developed in conjunction with major display driver manufacturers, is a new architecture with more advanced shader support, and allows the graphics processing unit to render more complex scenes without assistance from the CPU. It features improved load balancing between CPU and GPU and also optimizes data transfer between them.[17]
At the core of the operating system, many improvements have been made to the memory manager, process scheduler, heap manager, and I/O scheduler. A Kernel Transaction Manager has been implemented that gives applications the ability to work with the file system and registry using atomic transaction operations.
Security-related technologies
A User Account Control consent dialog.Main article: Security and safety features new to Windows Vista
Improved security was a primary design goal for Vista.[4] Microsoft's Trustworthy Computing initiative, which aims to improve public trust in its products, has had a direct effect on its development. This effort has resulted in a number of new security and safety features.
User Account Control is perhaps the most significant and visible of these changes. User Account Control is a security technology that makes it possible for users to use their computer with fewer privileges by default. This was often difficult in previous versions of Windows, as the previous "limited" user accounts proved too restrictive and incompatible with a large proportion of application software, and even prevented some basic operations such as looking at the calendar from the notification tray. In Windows Vista, when an action requiring administrative rights is requested, the user will be first prompted for an administrator name and password; in cases where the user is already an administrator, the user is still prompted to confirm the pending privileged action. User Account Control asks for credentials in a Secure Desktop mode, where the entire screen is blacked out, temporarily disabled, and only the authorization window is active and highlighted. The intent is to stop a malicious program 'spoofing' the user interface, attempting to capture admin credentials.
Internet Explorer 7's new security and safety features include a phishing filter, IDN with anti-spoofing capabilities, and integration with system-wide parental controls. For added security, ActiveX controls are disabled by default. Also, Internet Explorer operates in a "protected mode" which operates with lower permissions than the user and it runs in isolation from other applications in the operating system, preventing it from accessing or modifying anything besides the Temporary Internet Files directory.[18] Microsoft's anti-spyware product, Windows Defender, has been incorporated into Windows, providing protection against malware and other threats. Changes to various system configuration settings (such as new auto-starting applications) are blocked unless the user gives consent.
Another significant new feature is BitLocker Drive Encryption, a data protection technology included in the Enterprise and Ultimate editions of Vista that provides encryption for the entire operating system volume. Bitlocker can work in conjunction with a Trusted Platform Module chip (version 1.2) that is on a computer's motherboard, or with a USB key.[19]
A variety of other privilege-restriction techniques are also built into Vista. An example is the concept of "integrity levels" in user processes, whereby a process with a lower integrity level cannot interact with processes of a higher integrity level and cannot perform DLL–injection to a processes of a higher integrity level. The security restrictions of Windows services are more fine-grained, so that services (especially those listening on the network) have no ability to interact with parts of the operating system they do not need to. Obfuscation techniques such as address space layout randomization are used to increase the amount of effort required of malware before successful infiltration of a system. Code Integrity verifies that system binaries haven’t been tampered with by malicious code.
As part of the redesign of the network stack, Windows Firewall has been upgraded, with new support for filtering both incoming and outgoing traffic. Advanced packet filter rules can be created which can grant or deny communications to specific services.
Business technologies
Main article: Management features new to Windows Vista
While much of the focus of Vista's new capabilities has been on the new user interface, security technologies, and improvements to the core operating system, Microsoft is also adding new deployment and maintenance features.
The WIM image format (Windows IMage) is the cornerstone of Microsoft's new deployment and packaging system. WIM files, which contain an image of Windows Vista, can be maintained and patched without having to rebuild new images. Windows Images can be delivered via Systems Management Server or Business Desktop Deployment technologies. Images can be customized and configured with applications then deployed to corporate client personal computers using little to no touch by a system administrator. ImageX is the Microsoft tool used to create and customize images.
Windows Deployment Services replaces Remote Installation Services for deploying Vista and prior versions of Windows.
Approximately 700 new Group Policy settings have been added, covering most aspects of the new features in the operating system, as well as significantly expanding the configurability of wireless networks, removable storage devices, and user desktop experience. Vista also introduced an XML based format (ADMX) to display registry-based policy settings, making it easier to manage networks that span geographic locations and different languages. [20]
Services for UNIX has been renamed "Subsystem for UNIX-based Applications," and is included with the Enterprise and Ultimate editions of Vista. Network File System (NFS) client support is also included.
Multilingual User Interface - Unlike previous version of Windows which required language packs to be loaded to provide local language support, Windows Vista Ultimate and Enterprise editions supports the ability to dynamically change languages based on the logged on user's preference.
Wireless Projector support
Business customers who are enrolled in the Microsoft Software Assurance program are offered a set of additional tools and services collectively known as the "Desktop Optimization Pack". This includes the Microsoft SoftGrid application virtualization platform, an asset inventory service, and additional tools for maintaining Group Policy settings in a fashion similar to a revision control system.
Developer technologies
Windows Vista includes a large number of new application programming interfaces. Chief among them is the inclusion of version 3.0 of the .NET Framework, which consists of a class library and Common Language Runtime. Version 3.0 includes four new major components:[21]
Windows Presentation Foundation is a user interface subsystem and framework based vector graphics, which will make use of 3D computer graphics hardware and Direct3D technologies. It provides the foundation for building applications and blending together application UI, documents, and media content. It is the successor to Windows Forms.
Windows Communication Foundation is a service-oriented messaging subsystem which will enable applications and systems to interoperate locally or remotely using Web services.
Windows Workflow Foundation provides task automation and integrated transactions using workflows. It is the programming model, engine and tools for building workflow-enabled applications on Windows.
Windows CardSpace is a component which securely stores digital identities of a person, and provides a unified interface for choosing the identity for a particular transaction, such as logging into a website.
These technologies will also be available for Windows XP and Windows Server 2003 to facilitate their introduction to and usage by developers and end users.
There are also significant new development APIs in the core of the operating system, notably the completely re-architected audio, networking, print, and video interfaces, major changes to the security infrastructure, improvements to the deployment and installation of applications ("ClickOnce" and Windows Installer 4.0), new device driver development model ("Windows Driver Foundation"), Transactional NTFS, mobile computing API advancements (power management, Tablet PC Ink support, SideShow) and major updates to (or complete replacements of) many core subsystems such as Winlogon and CAPI.
There are some issues for software developers using some of the graphics APIs in Vista. Games or programs which are built solely on Vista's version of DirectX, 10, will not work on prior versions of Windows, as DirectX 10 is not backwards-compatible at any level.[22] According to a Microsoft blog, there are three choices for OpenGL implementation on Vista. An application can use the default implementation, which translates OpenGL calls into the Direct3D API and is frozen at OpenGL version 1.4, or an application can use an Installable Client Driver (ICD), which comes in two flavors: legacy and Vista-compatible. A legacy ICD, the kind already provided by independent hardware vendors targeting Windows XP, will disable the Desktop Window Manager, noticeably degrading user experience under Windows Aero. A Vista-compatible ICD takes advantage of a new API, and will be fully compatible with the Desktop Window Manager.[23] At least two primary vendors, ATI and NVIDIA, are expected to provide full Vista-compatible ICDs in the near future.[24] However, hardware overlay is not supported, because it is considered as an obsolete feature in Vista. ATI and NVIDIA strongly recommend using compositing desktop/FBOs for same functionality.[25]
Welcome Center
Welcome Center can display an overview of the new features, set up new users, and set protection options for the PC. Welcome Center is run from the System and Maintenance menu of the Control Panel menu and by default, is run upon first boot of Windows Vista.
Some Welcome Center options can connect online via the Internet to Microsoft websites for accessing or downloading various files to the user's computer.
Deprecated features
Main article: Features removed from Windows Vista
Some notable Windows XP features and components have been replaced or removed in Windows Vista, including Windows Messenger, the network Messenger Service, HyperTerminal, MSN Explorer, Active Desktop, and the replacement of NetMeeting with Windows Meeting Space. Windows Vista also does not include the Windows XP "Luna" visual theme, or most of the classic color schemes which have been part of Windows since the Windows 3.x era. The "Hardware profiles" startup feature has been removed as well, along with support for older motherboard technologies like the EISA bus, APM and Game port support. IP over 1394 (TCP/IP over IEEE 1394) has been removed.[26]
WinHlp32.exe, used to display 32-bit .hlp files (help pages), is no longer included in Windows Vista as Microsoft considers it obsolete,[27] though it is available as a separate download. Microsoft prohibits software manufacturers from re-introducing the .hlp help system with their products.
Telnet.exe is no longer installed by default, but is still included as an installable feature.[28]
Editions and pricing
Windows Vista Home Basic Upgrade Edition - Full English ContentsMain article: Windows Vista editions and pricing
Windows Vista ships in six editions.[29] These editions are roughly divided into two target markets, consumer and business, with editions varying to cater for specific sub-markets. For consumers, there are four editions, with three available for Western countries; Windows Vista Starter is limited to emerging markets. Windows Vista Home Basic is intended for budget users with low needs. Windows Vista Home Premium covers the majority of the consumer market. Windows Vista Ultimate contains the complete feature-set and is aimed at enthusiasts. For businesses, there are two versions. Windows Vista Business covers organizations of all sizes, while Windows Vista Enterprise is only available to customers participating in Microsoft's Software Assurance program.
In the European Union, Home Basic N and Business N versions will also be available. These versions come without Windows Media Player, due to EU sanctions brought against Microsoft for violating anti-trust laws. Similar sanctions exist in South Korea.
Visual styles
Windows Vista has four distinct visual styles.[30]
Windows Flip 3D (Win+Tab keys)
Windows Flip (Alt+Tab keys)
Live Thumbnails (Win+T keys)Windows Aero
Windows Vista's premier visual style is built on a new desktop composition engine called Desktop Window Manager. Windows Aero introduces support for 3D graphics (Windows Flip 3D), translucency effects (Glass), live thumbnails, window animations, and other visual effects, and is intended for mainstream and high-end graphics cards. To enable these features, the contents of every open window is stored in video memory to facilitate tearing-free movement of windows. As such, Windows Aero has significantly higher hardware requirements than its predecessors. 128 MB of graphics memory is the minimum requirement, depending on resolution used.[31] Windows Aero (including Windows Flip 3D) is not included in the Starter and Home Basic editions.
Windows Vista Standard
This mode is a variation of Windows Aero without the glass effects, window animations, and other advanced graphical effects such as Windows Flip 3D. Like Windows Aero, it uses the Desktop Window Manager, and has generally the same video hardware requirements as Windows Aero. This is the default mode for the Windows Vista Home Basic Edition. The Starter Edition does not support this mode.
Windows Vista Basic
This mode has aspects that are similar to Windows XP's visual style with the addition of subtle animations such as those found on progress bars. It does not employ the Desktop Window Manager; as such, it does not feature transparency or translucency, window animation, Windows Flip 3D or any of the functions provided by the DWM. The Basic mode does not require the new Windows Display Driver Model (WDDM) for display drivers, and has similar graphics card requirements to Windows XP. For computers with graphics cards that are not powerful enough to support Windows Aero, this is the default graphics mode.
Windows Classic
An option for corporate deployments and upgrades, Windows Classic has the look and feel of Windows 2000 and Windows Server 2003, does not use the Desktop Window Manager, and does not require a WDDM driver. As with prior versions of Windows, this visual style supports "color schemes," which are a collection of color settings. Windows Vista includes six classic color schemes, comprised of four high-contrast color schemes and the default color schemes from Windows 98 and Windows 2000.
"Windows Aero" visual style.
"Windows Vista Basic" visual style.
"Windows Classic" visual style.
Hardware requirements
Computers capable of running Windows Vista are classified as Vista Capable and Vista Premium Ready.[32] A Vista Capable or equivalent PC will be capable of running all editions of Windows Vista although some of the special features and high end graphics options may require additional or more advanced hardware. A Vista Premium Ready PC will take advantage of Vista's "high-end" features.[33]
Windows Vista's "Basic" and "Classic" interfaces will work with virtually any graphics hardware that supports Windows XP or 2000; accordingly, most discussion around Vista's graphics requirements centers on those for the Windows Aero interface. As of Windows Vista Beta 2, the NVIDIA GeForce FX 5200 and later, the ATI Radeon 9500 and later, Intel's GMA 950 integrated graphics, and a handful of VIA chipsets and S3 Graphics discrete chips are supported.[34] Microsoft offers a tool called the Windows Vista Upgrade Advisor[35] to assist XP and Vista users in determining what versions of Windows their machine is capable of running.
Windows Vista system requirements Vista Capable[31] Vista Premium Ready[31]
Processor 800 MHz 1.0 GHz
Memory 512 MB RAM 1 GB RAM
Graphics card DirectX 9 capable DirectX 9 capable GPU with Hardware Pixel Shader v2.0 and WDDM 1.0 driver support
Graphics memory N/A 128 MB RAM supports up to 2,756,000 total pixels (e.g. 1920 × 1200) or 512 MB+ for greater resolutions such as 2560x1600[36]
HDD capacity 20 GB 40 GB
HDD free space 15 GB 15 GB
Other drives DVD-ROM DVD-ROM
Service Pack 1
This article or section contains information about scheduled or expected future software.
The content may change dramatically as the software release approaches and more information becomes available.
Windows Vista Service Pack 1 (SP1) is currently in development. Microsoft is planning to release SP1 alongside Windows Server 2008 in the second half of 2007,[37][38] with a beta later this year.[39]
Microsoft is known to be planning to include the following changes in SP1:
Improvements to Group Policy management tools.[40]
Performance improvements with Windows Disk Defragmenter that are also slated for Server 2008.[41]
New security APIs for the benefit of antivirus software that currently relies on the unsupported practice of patching the kernel (see Kernel Patch Protection).[42][43]
A new version of Windows Installer, version 4.1.[44]
Users will be able to change the default desktop search program to one provided by a third party instead of the Microsoft desktop search program that comes with Windows Vista. Third-party desktop search programs will be able to seamlessly tie in their services into the operating system.[38]
A bug in ReadyBoost causing poor performance after resuming from Sleep or Hibernate will be fixed.[45]
Reports from various sources have suggested that SP1 will include a kernel that will be up-to-date with the version to be shipped with Windows Server 2008.[46] A newer version of Windows Media Center is under development, but whether this will be included with the service pack, or be released separately, has not been clarified by Microsoft.
Criticism
Main article: Criticism of Windows Vista
Criticisms of Windows Vista include protracted development time, more restrictive licensing terms, the inclusion of a number of technologies aimed at restricting the copying of protected digital media,[47] and the usability of the new User Account Control security technology. Reviewers have also noted similarities between Vista's Aero interface and that of Apple's Aqua interface for the Mac OS X operating system, particularly around the use of transition effects. Moreover, some concerns have been raised about many PCs meeting "Vista Premium Ready" hardware requirements and Vista's pricing.
Licensing and cost
The introduction of additional licensing restrictions has been criticized. Criticism of upgrade licenses pertaining to Windows Vista Starter through Home Premium was expressed by Ars Technica's Ken Fisher, who noted that the new requirement of having a prior operating system already installed was going to cause irritation for users who reinstall Windows on a regular basis.[48] It has been revealed that an Upgrade copy Windows Vista can be installed clean without first installing a previous version of Windows. On the first install, Windows will refuse to activate. The user must then reinstall that same copy of Vista. Vista will then activate on the reinstall, thus allowing a user to install an Upgrade of Windows Vista without owning a previous operating system.[49] As with Windows XP, separate rules still apply to OEM versions of Vista installed on new PCs; these are not legally transferrable.[50] The cost of Windows Vista has also been a source of concern and commentary. A majority of users in a poll said that the prices of various Windows Vista editions posted on the Microsoft Canada website in August 2006 make the product too expensive.[51] A BBC News report on the day of Vista's release suggested that, "there may be a backlash from consumers over its pricing plans - with the cost of Vista versions in the US roughly half the price of equivalent versions in the UK."[52]
Digital Rights Management
Another common criticism concerns the integration of new forms of Digital Rights Management into the operating system, specifically the introduction of the Protected Video Path. This architecture is designed such that "premium content" from HD DVD or Blu-ray discs may mandate that the connections between PC components be encrypted. Devices such as graphic cards must be approved by Microsoft. Depending on what the content demands, the devices may not pass premium content over non-encrypted outputs, or they must artificially degrade the quality of the signal on such outputs or not display it all. There is also a revocation mechanism that allows Microsoft to disable drivers of compromised devices in end-user PCs over the Internet.[53] Peter Gutmann, security researcher and author of the open source cryptlib library, claims that these mechanisms violate fundamental rights of the user (such as fair use), unnecessarily increase the cost of hardware, and make systems less reliable and vulnerable to denial-of-service attacks.[54] Proponents have claimed that Microsoft had no choice but to follow the demands of the movie studios, and that the technology will not actually be enabled until after 2010;[55][56] Microsoft also noted that content protection mechanisms have existed in Windows as far back as Windows Me, and that the new protections will not apply to any existing content (only future contents).[57]
User Account Control
Concerns have been raised about the new User Account Control (UAC) security technology. While Yankee Group analyst Andrew Jaquith believes that critical security vulnerabilities may be "reduced by as much as 80%," he also noted that "while the new security system shows promise, it is far too chatty and annoying."[58] However, this statement was made over six months before Vista was actually released (even before Beta 2 was released). By the time Windows Vista was released in November 2006, Microsoft had drastically reduced the number of operating system tasks that triggered UAC prompts, and added file and registry virtualization to reduce the number of legacy applications that trigger UAC prompts.[59]
Similarity to Mac OS X
Another criticism is a claim by some that Windows Vista emulates specific features in Apple's Mac OS X. Long-time Mac columnist and book author John Rizzo noted in an eWeek article that Vista incorporated features which Mac OS X has had for some time such as fast searching, seen in the Spotlight feature on the Mac, Smart Folders functionality already available in the Mac's Finder, and that the icons, terminology and visual appearance mimic those of Mac OS X.[60] Others have come to a similar conclusion that Aero is an imitation of Aqua.[61] However, some of these counterparts or similarities (such as Windows Desktop Search to Mac OS X's Spotlight) were included in early alpha versions of Vista, demonstrated in prototypes, or released as products for Windows XP before Apple included the features in Mac OS X v10.4.[62][63]
Hardware requirements
Some controversy and concerns have arisen over how the increase in hardware specifications required to take advantage of many of Vista's new features may have an impact on both personal and business users.[64][65] While most Desktop PCs purchased after 2002 and laptops purchased after 2005 will be able to meet Vista’s minimum “Windows Vista Capable” requirements, many laptops and low-end to midrange desktops with integrated graphics will not be able to meet “Windows Vista Premium Ready” requirements and will therefore not be able to run advanced features such as the Aero Glass interface.[66][67]
Software Protection Platform
Vista includes an enhanced set of anti-piracy technologies, based on Windows XP's WGA, called Software Protection Platform (SPP).[68]. A major component of this is a new reduced functionality mode, which Vista enters when it detects that the user has "failed product activation or of that copy being identified as counterfeit or non-genuine",[69] which is described in a Microsoft white paper as follows: "The default Web browser will be started and the user will be presented with an option to purchase a new product key. There is no start menu, no desktop icons, and the desktop background is changed to black. [...] After one hour, the system will log the user out without warning".[70] This has been criticised for being overly draconian,[71][72] especially given the imperfect false-positive record of SPP's predecessor, WGA.[73]
Posted by Ankit at 8:47 AM 0 comments
Friday, June 29, 2007
Speed Switch v/s if Else
Speed Test: Switch vs If-Else-If
The .NET framework and the C# language provide two methods for conditional processing where multiple discrete values can be selected from. The switch statement is less flexible than the if-else-if ladder but is generally considered to be more efficient.
Test Description
Purpose
This test was designed to compare the execution time of the switch statement and the if-else-if ladder code structure when used to select a match from a discrete series of values. The if-else-if ladder provides much greater flexibility than is used by the test but, when being used to provide matching functionality to switch, this does not need to be considered. The two conditional processing structures are described in the article, C# Program Flow Control: Conditional Processing.
Test Process Functionality
It was important that the speed test for the two statements provided exactly the same functionality in both cases. For each test, an integer value between zero and nineteen was generated. This integer value was then compared against nineteen possible selections using if commands and case statements. Where the integer value generated was nineteen, this was not matched and instead processed using the final else statement or the switch command's default case.
In many programming situations, a selection of this kind is very likely to generate a match. However, for completeness, a second test was performed. This test followed the same functionality but using an integer value that did not match any of the possible values; it therefore always used the final else statement or the switch command's default case.
Looping
The speed of execution of a large if-else-if ladder or select statement is too fast to me accurately measured. To make measuring possible and to reduce anomalies, a loop was constructed and the test code executed repeatedly. For each test, the loop completed one billion (1,000,000,000) iterations.
The looping function for the first test was used to generate the integer value to match. For each iteration in a for loop, the loop control variable was used with the modulus operator to create a comparison value between zero and nineteen.
In addition to executing the test with value-matching and the test without value-matching, the loop code was executed with no internal test code. Two versions of empty loop were used, one with the number generation code and one without. These two tests provided baseline timings that could be subtracted from the actual test times.
Timing
The timing of the tests was controlled automatically using the Stopwatch class. Each test was performed repeatedly and the mean average of the results calculated.
Code
Click this link to download the code for the class used to perform the tests.
Test Conditions
Hardware
The test results included below are those produced using an Athlon64 3200+ with 4GB RAM. These tests are indicative of further relative test results that were carried out on a variety of equipment including:
IBM ThinkPad R51 notebook with a 1.6GHz processor and 2GB RAM
JVC MiniNote notebook with a 1GHz processor and 768MB RAM
The tests were executed using three operating systems, each with the latest service packs and patches. These were:
Windows XP
Windows Server 2003 R2
Windows Vista Ultimate
In each test, the software was compiled as a .NET framework 2.0 console application in three configurations:
Compiled for 32-bit processors only using Visual Studio 2005 Team Edition
Compiled for 32-bit or 64-bit processors using Visual Studio 2005 Team Edition
Compiled using Visual C# 2005 Express Edition
Results
Raw Results
This table shows the timings for the empty loop, if statement and switch statement for one billion iterations rounded to the nearest millisecond. The two columns show the results for the loops where matching of the comparison value occurs and for the non-matching tests.
Matching Non-Matching
Empty Loop 27.3s 5.0s
Switch Statement 43.0s 5.0s
If Statement 48.0s 5.1s
Adjusted Results
This second table shows the results for the two key test types, adjusted to remove the delay created by the looping mechanism.
Matching Non-Matching
Switch Statement 15.7s 0.0s
If Statement 20.7s 0.1s
Conclusion
The results show that the switch statement is faster to execute than the if-else-if ladder. This is due to the compiler's ability to optimise the switch statement. In the case of the if-else-if ladder, the code must process each if statement in the order determined by the programmer. However, because each case within a switch statement does not rely on earlier cases, the compiler is able to re-order the testing in such a way as to provide the fastest execution.
Posted by Ankit at 1:11 PM 0 comments
Friday, June 22, 2007
Exception Handling
C# Exception Handling
What is an Exception?
An exception is an error or failure that occurs when a program is executing. Generally, an exception describes an event that was unexpected. For example, an exception will occur if a program requests more memory than the operating system can provide. This error is known as an Out of Memory Exception.
The Exception Class Hierarchy
When an exception occurs normal processing of the code ceases immediately. An object is then generated that contains information relating to the error. This object is an instance of an Exception class. The most basic of the exception classes is System.Exception, the Exception class defined in the System namespace.
The exception classes are organised into a hierarchy with Exception at the top. Beneath the basic Exception class are two further classes, SystemException and ApplicationException, both in the System Namespace. The SystemException class has further derived subclasses, each representing a specific type of exception that can be raised in response to a system error. The ApplicationException class is a base class from which custom application exceptions may be derived.
NB: Subclass and base class are object-oriented programming terms. Object oriented programming is beyond the scope of the C# Fundamentals tutorial and will be described in a future series of articles.
System Exceptions
There are many system exceptions that may be raised, or thrown, when a problem occurs. These cause the generation of an object based on its own specialised exception class derived from SystemException. Examples include:
ArithmeticException. Thrown when an error occurs during an arithmetic operation or during casting or converting.
DivideByZeroException. Thrown when an attempt to divide a value by zero occurs. The DivideByZeroException is a more specialised version of ArithmeticException.
OverflowException. Thrown when an error occurs during an arithmetic operation or during casting or converting because the resultant value is too large or too small. The OverflowException is derived from ArithmeticException.
OutOfMemoryException. Thrown when the available memory is insufficient to continue execution of a program.
The above list gives a small sample of some of the exception classes within the hierarchy. A much more comprehensive list can be found in the System Exceptions Hierarchy page of Microsoft's MSDN web site.
Application Exceptions
Application exceptions are defined by the programmer and can be quite generic, for example WordProcessorException, or very specialised, such as LeftMarginTooSmallException. Of course, neither of these exceptions exists within the .NET framework; they must be created before use. For this reason, application exceptions will not be discussed in this article. Instead they will be described in the next article, which investigates programmatically throwing both standard and custom exceptions.
Handling Exceptions
Unhandled Exceptions
When an exception occurs the program flow for the executing method is immediately interrupted. If the exception is not handled explicitly, the method exits and the exception is propagated back to the calling function. This calling method then has the opportunity to handle the error. This process continues until the exception is handled by the program or, if never handled, it reaches the C# runtime system.
An unhandled exception that reaches the C# runtime system causes the immediate, abnormal termination of the program. This can be a problem as the exception is reported to the user as a message or dialog box containing standard information and technical details that may be misunderstood. During debugging this may be useful but in a production system it is generally considered to be unacceptable. It can also permit the user to attempt to continue running a program that, due to errors, has become unstable; note the Continue button in the error dialog box below:
The Basic Try / Catch Block
C# provides a code structure known as the try / catch block that permits the handling of exceptions. A basic try / catch block has two elements. The try section contains a series of commands to be executed, held within the brace characters { and }. The catch section contains code to execute should an exception occur during processing of the try section. The basic syntax is as follows:
try
{
// commands to execute whilst checking for exceptions
}
catch
{
// commands to execute if an exception occurs
}When using this basic exception capturing syntax, any exception that occurs causes the code in the try block to be left and the code in the catch block to be executed. The catch block code can be used for various purposes including graceful recovery from the error, logging or reporting of the details of the problem, and freeing up resources such as database connections or open files. Once the catch block has finished executing, or if no exception occurs within the try block, the program continues with the next statement after the try / catch structure.
The following example attempts to divide a value by zero causing an exception to be thrown. In this case, a simple error message is reported to the user and the calculated value is set to the highest possible integer value.
static void Main(string[] args)
{
int value = 50;
int divisor = 0;
int calculated;
try
{
calculated = value / divisor;
}
catch
{
Console.WriteLine("An error occurred during division.");
calculated = int.MaxValue;
}
Console.WriteLine("Result = {0}", calculated);
}
/* OUTPUT
An error occurred during division.
Result = 2147483647
*/Extracting Exception Information
As described earlier in this article, the throwing of an exception includes the generation of an exception object. the object has properties containing information describing the error that occurred. This information can be made available to the code within the catch code block by adding an exception declaration to the catch statement. The following example extends the previous code by declaring an object of the most generalised Exception class. All exceptions will still be caught but now the exception information may be used when generating the error message.
static void Main(string[] args)
{
int value = 50;
int divisor = 0;
int calculated;
try
{
calculated = value / divisor;
}
catch (Exception ex) // Catch any exception
{
Console.WriteLine("An error occurred during division.");
Console.WriteLine(ex.Message); // Report the error message
calculated = int.MaxValue;
}
Console.WriteLine("Result = {0}", calculated);
}
/* OUTPUT
An error occurred during division.
Attempted to divide by zero.
Result = 2147483647
*/The above example catches any error and populates an object of class Exception. The Message property of the object is then used to output an error description. This is one of several useful properties that are provided by the Exception class and all other derived exception types. Some of the most useful properties are:
Message. A string providing a brief description of the exception.
Source. A string containing the name of the program or object that caused the exception.
TargetSite. An object containing the name and other details of the method that caused the exception.
StackTrace. A string containing the complete stack of calls that led to the exception. This string allows the programmer to review each method call made up until the exception occurred. This is especially useful during testing and debugging.
InnerException. When one exception occurs as the direct result of another exception, the initial exception may be held in this property. This allows interrogation of both objects. The inner exception contains all of the standard properties including, potentially, a further InnerException. If there is no inner exception, this property is null.
NB: More specialised exception types may include further relevant information. For example, the ArgumentException and derived exceptions that are thrown when a parameter passed to a method is invalid include a 'ParamName' property detailing the parameter in question.
static void Main(string[] args)
{
int value = 50;
int divisor = 0;
int calculated;
try
{
calculated = value / divisor;
}
catch (Exception ex)
{
Console.WriteLine("Message: {0}\n", ex.Message);
Console.WriteLine("Source: {0}\n", ex.Source);
Console.WriteLine("TargetSite: {0}\n", ex.TargetSite.Name);
Console.WriteLine("StackTrace: {0}\n", ex.StackTrace);
calculated = int.MaxValue;
}
Console.WriteLine("Result = {0}", calculated);
}
/* OUTPUT
Message: Attempted to divide by zero.
Source: ConsoleApplication1
TargetSite: Void Main(System.String[])
StackTrace: at ConsoleApplication1.Program.Main(String[] args) in
C:\...\Program.cs:line 17
Result = 2147483647
*/Catching Specific Exceptions
So far, the examples described have included code to catch all exceptions. However, sometimes you will want to catch only a specific type of exception so that different problems can be handled in different ways. In order to catch a more specialised exception only, the correct class of exception is named in the catch statement. The following example uses this method to only catch division by zero. Any other exception would remain unhandled.
static void Main(string[] args)
{
int value = 50;
int divisor = 0;
int calculated;
try
{
calculated = value / divisor;
}
catch (DivideByZeroException ex) // Catch specific exception only
{
Console.WriteLine("Division by zero occurred.");
Console.WriteLine(ex.Message); // Report the error message
calculated = int.MaxValue;
}
Console.WriteLine("Result = {0}", calculated);
}
/* OUTPUT
Division by zero occurred.
Attempted to divide by zero.
Result = 2147483647
*/Catching specific exception types provides two benefits. Firstly, unexpected exceptions such as out of memory are not caught and misinterpreted or masked causing unexpected side effects. Secondly, any additional properties associated with the specialised exception class are made available in the catch block.
NB: If catching the exception type is enough and it is not necessary to interrogate the exception properties then there is no need to include a variable name for the exception object. The catch in the above example could be shortened to catch (DivideByZeroException) in such a situation.
Catching Multiple Exceptions
When developing complex routines, it is possible that many different types of exception could occur within a block of code or even within a single instruction. Each of these exceptions may require handling in a different manner. To permit this, multiple catch blocks may be added to a single try block. Each of these catch blocks handles a different kind of exception with the most specific exception types processed first and the most generic exceptions last.
Each catch block is checked in turn to see if the exception thrown is the same type as, or derives from, that declared in the catch statement. When a match is found, the code within the catch block is executed. Only one catch block's code is ever executed. Exceptions thrown that do not match any of the declared types remain unhandled.
The following example includes three catch blocks. The first handles any division by zero error. The second responds to a less general arithmetic exception but is not used if division by zero occurs. The final catch block does not specify the type of exception to catch and therefore is executed when any other type of exception occurs.
static void Main(string[] args)
{
int value = 50;
int divisor = 0;
int calculated;
try
{
calculated = value / divisor;
}
catch (DivideByZeroException) // Division by zero?
{
Console.WriteLine("Division by zero occurred.");
calculated = int.MaxValue;
}
catch (ArithmeticException) // Arithmetic exception?
{
Console.WriteLine("An arithmetic exception occured.");
calculated = int.MaxValue;
}
catch
{
Console.WriteLine("An unexpected exception occured.");
calculated = int.MaxValue;
}
Console.WriteLine("Result = {0}", calculated);
}
/* OUTPUT
Division by zero occurred.
Attempted to divide by zero.
Result = 2147483647
*/The Try / Catch / Finally Block
Sometimes it is necessary to ensure that some code executes whether an exception occurs or not. For example, if a file is opened before the try block, this file should be properly closed following successful processing or an exception.
C# defines an addition block that may be added to the end of the try / catch code structure. This is known as the finally block. The code within this section is guaranteed to be executed after the try / catch block, even if any of the statements in the try / catch block caused the current method to exit normally or by throwing a further exception.
static void Main(string[] args)
{
int value = 50;
int divisor = 0;
int calculated;
try
{
calculated = value / divisor;
}
catch
{
Console.WriteLine("An error occurred during division.");
calculated = int.MaxValue;
}
finally
{
Console.WriteLine("Clearing up any resources.");
}
Console.WriteLine("Result = {0}", calculated);
}
/* OUTPUT
An error occurred during division.
Clearing up any resources.
Result = 2147483647
*/It is possible to use try and finally together with no catch blocks. If an exception occurs when using such a structure it remains unhandled and is thrown to the calling routine or to the C# runtime system. However, the code in the finally block is executed whether an exception is raised or not.
Posted by Ankit at 12:06 PM 0 comments
Monday, June 18, 2007
C#
Monday, June 18, 2007C# An Extensive Examination of Data Structures Using C# 2.0
Summary: This article kicks off a six-part article series that focuses on important data structures and their use in application development. We'll examine both built-in data structures present in the .NET Framework, as well as essential data structures we'll build ourselves. This first part focuses on an introduction to data structures, defining what data structures are, how the efficiency of data structures are analyzed, and why this analysis is important. In this article, we'll also examine two of the most commonly used data structures present in the .NET Framework: the Array and List. (14 printed pages)
Editor's note This six-part article series originally appeared on MSDN Online starting in November 2003. In January 2005 it was updated to take advantage of the new data structures and features available with the .NET Framework version 2.0, and C# 2.0. The original articles are still available at
Contents
Introduction
Analyzing the Performance of Data Structures
Everyone's Favorite Linear, Direct Access, Homogeneous Data Structure: The Array
Creating Type-Safe, Performant, Reusable Data Structures
The List – a Homogeneous, Self-Redimensioning Array
Conclusion
Introduction
Welcome to the first in a six-part series on using data structures in .NET 2.0. This article series originally appeared on MSDN Online in October 2003, focusing on the .NET Framework version 1.x, and can be accessed at
Version 2.0 of the .NET Framework adds new data structures to the Base Class Library, along with new features, such as Generics, that make creating type-safe data structures much easier than with version 1.x. This revised article series introduces these new .NET Framework data structures and examines using these new language features.
Throughout this article series, we will examine a variety of data structures, some of which are included in the .NET Framework's Base Class Library and others that we'll build ourselves. If you're unfamiliar with the term, data structures are classes that are used to organize data and provide various operations upon their data. Probably the most common and well-known data structure is the array, which contains a contiguous collection of data items that can be accessed by an ordinal index.
Before jumping into the content for this article, let's first take a quick peek at the roadmap for this six-part article series, so that you can see what lies ahead.
In this first part of the six-part series, we'll look at why data structures are important, and their effect on the performance of an algorithm. To determine a data structure's effect on performance, we'll need to examine how the various operations performed by a data structure can be rigorously analyzed. Finally, we'll turn our attention to two similar data structures present in the .NET Framework: the Array and the List. Chances are you've used these data structures in past projects. In this article, we'll examine what operations they provide and the efficiency of these operations.
In the Part 2, we'll explore the List's "cousins," the Queue and Stack. Like the List, both the Queue and Stack store a collection of data and are data structures available in the .NET Framework Base Class Library. Unlike a List, from which you can retrieve its elements in any order, Queues and Stacks only allow data to be accessed in a predetermined order. We'll examine some applications of Queues and Stacks, and see how these classes are implemented in the .NET Framework. After examining Queues and Stacks, we'll look at hashtables, which allow for direct access like an ArrayList, but store data indexed by a string key.
While arrays and Lists are ideal for directly accessing and storing contents, when working with large amounts of data, these data structures are often sub-optimal candidates when the data needs to be searched. In Part 3, we'll examine the binary search tree data structure, which is designed to improve the time needed to search a collection of items. Despite the improvement in search time with the binary tree, there are some shortcomings. In Part 4, we'll look at SkipLists, which are a mix between binary trees and linked lists, and address some of the issues inherent in binary trees.
In Part 5, we'll turn our attention to data structures that can be used to represent graphs. A graph is a collection of nodes, with a set of edges connecting the various nodes. For example, a map can be visualized as a graph, with cities as nodes and the highways between them as edged between the nodes. Many real-world problems can be abstractly defined in terms of graphs, thereby making graphs an often-used data structure.
Finally, in Part 6 we'll look at data structures to represent sets and disjoint sets. A set is an unordered collection of items. Disjoint sets are a collection of sets that have no elements in common with one another. Both sets and disjoint sets have many uses in everyday programs, which we'll examine in detail in this final part.
Analyzing the Performance of Data Structures
When thinking about a particular application or programming problem, many developers (myself included) find themselves most interested about writing the algorithm to tackle the problem at hand or adding cool features to the application to enhance the user's experience. Rarely, if ever, will you hear someone excited about what type of data structure they are using. However, the data structures used for a particular algorithm can greatly impact its performance. A very common example is finding an element in a data structure. With an unsorted array, this process takes time proportional to the number of elements in the array. With binary search trees or SkipLists, the time required is logarithmically proportional to the number of elements. When searching sufficiently large amounts of data, the data structure chosen can make a difference in the application's performance that can be visibly measured in seconds or even minutes.
Since the data structure used by an algorithm can greatly affect the algorithm's performance, it is important that there exists a rigorous method by which to compare the efficiency of various data structures. What we, as developers utilizing a data structure, are primarily interested in is how the data structures performance changes as the amount of data stored increases. That is, for each new element stored by the data structure, how are the running times of the data structure's operations effected?
Consider the following scenario: imagine that you are tasked with writing a program that will receive as input an array of strings that contain filenames. Your program's job is to determine whether that array of strings contains any filenames with a specific file extension. One approach to do this would be to scan through the array and set some flag once an XML file was encountered. The code might look like so:
Copy Code
public bool DoesExtensionExist(string [] fileNames, string extension)
{
int i = 0;
for (i = 0; i < fileNames.Length; i++)
if (String.Compare(Path.GetExtension(fileNames[i]), extension, true) == 0)
return true;
return false; // If we reach here, we didn't find the extension
}
}
Here we see that, in the worst-case—when there is no file with a specified extension, or when there is such a file but it is the last file in the list—we have to search through each element of the array exactly once. To analyze the array's efficiency at sorting, we must ask ourselves the following: "Assume that I have an array with n elements. If I add another element, so the array has n + 1 elements, what is the new running time?" (The term "running time," despite its name, does not measure the absolute time it takes the program to run, but rather refers to the number of steps the program must perform to complete the given task at hand. When working with arrays, typically the steps considered are how many array accesses one needs to perform.) Since to search for a value in an array we need to visit, potentially, every array value, if we have n + 1 array elements, we might have to perform n + 1 checks. That is, the time it takes to search an array is linearly proportional to the number of elements in the array.
Posted by Ankit at 6:02 PM 0 comments
Subscribe to: Posts (Atom)
Posted by Ankit at 6:02 PM 0 comments