Tuesday, February 23, 2010

What Does a Singularity Look Like?


Cosmology: The Higgs Singularity

The quantum uncertainty of the Higgs vacuum fluctuation singularity that exploded into the big bang over thirteen billions years ago was certainly indifferent to the birth a universe with life on Earth which now suffers from the endless burden of seeking, “Why?”

Why symmetry breaking singularities? Why an Uncertainty Principle? Why, why why….

Some answers appear in tantalizing dribs and drabs from inspired ideas and ingenious experiments. They produce knowledge in the form of Astrophysics which is one branch of astronomy that explores the physics of the universe: galaxies, stars, planets, exoplanets, the interstellar medium and the cosmic microwave background. Or Cosmology which is a sub-branch of astrophysics studying the origin of large scale properties of the universe including the big bang. What imperfect answers do these endeavors offer? Let’s look.

In 1976, particle physics developed the Standard Model of Quantum Mechanics representing the three forces (electromagnetic, weak and strong) as U(1) x SU(2) x SU(3) with exceptional accuracy. Each of the forces in the Standard Model is a product of gauge theories with complex charges that mutually interact in a highly symmetric way.

The development of Grand Unified Theory (GUT) was intended to unify electromagnetic, weak and strong interactions of the Standard Model in terms of a single fully unified interaction. While this still left out gravity it was expected to be an excellent approximation to nature. The GUT gave a specific reason for the charge symmetry of electrons and protons. Also super-symmetry gave an intersecting point where all three force’s coupling constants merged at 10^16 Gev. GUT predicted that there were two early universe phase transitions. The first would be at a high temperature phase transition breaks the gravity symmetry from the GUT forces and generates a large amount of supercooling and delaying the GUT second phase transition which would occur suppressing monopoles production. The supercooling causes the second phase transition to occur at a temperature well below the normal phase transition temperature before the actual transition occurs. Water can be supercooled to 20 degrees below freezing before it turns to ice. With GUT transition postponed until after supercooling the correct monopole production rate can be expected. In addition supercooling would cause a false vacuum that leads to a strong gravitational repulsion that creates an exponential inflationary expansion of the universe. In effect the false vacuum creates a gravitational effect identical to Einstein’s cosmological constant. The expansion doubling time is 10^-37 seconds. Therefore 100 doublings (10^30 time its original size) would take only 10^-35 seconds.

The superecooling phase transition is of First Order that cause Inflationary expansion of the universe.


In July 2012, The Higgs Boson was discovered.

The singularity that broke symmetry changing one force into three/four forces occurred in stages starting at 10^16 Gev, 10^29 degree Kelvin, 10^-39 seconds after the big bang. The original single force coupling constant changed into four coupling constants that began to diverge in value. The matter-antimatter ratio was slightly imbalanced and matter became slightly dominate due to cooling shutting off prior to baryon neucleogenesis reaching equilibrium (10^78 baryons now in the universe). During the big bang inflationary expansion proceeded at faster than the speed of light.

General Relativity is an extremely accurate theory for gravity but is classical and does not include quantum effects. The inability to reconcile the two theories is due to the appearance of infinity expressions that cannot be renormalized.



Radiation: is composed of massless or nearly massless particles that move at the speed of light including photons (light) and neutrinos. Their emissions are examined across all parts of the electromagnetic spectrum.

Mass is E/c^2 occurs a quark (or particle) is disturbed in a gluon field.

Photons are moving disturbance within an electromagnetic field.

Baryonic matter: is ordinary matter composed primarily of protons, neutrons and electrons. Dark energy: is a property of the vacuum itself, characterized by negative pressure (repelling force) causing the expansion of the universe to accelerate, or speed up. Dark matter: exotic non-baryonic matter that interacts only weakly with ordinary matter. The Big Bang employs two critical ideas: General Relativity and the Cosmological Principle. Matter distributed uniformly allows computing the property of space-time using General Relativity. It was a simultaneous explosion of space everywhere in the universe rather than a single point explosion.

Inflation was a phenomena similar to Phase transition after the big band causing super-cooling, super-expansion symmetry breaking splitting the forces at time 10^-37 seconds after big bang. Inflation stopped the production of Monopoles, explains the flatness problem (Euclidean geometry preference) the critical density omega = 1.0.
The phase transition was a 1st Order Phase Transition (like boiling water with supercooling). This is the second phase transition to occur after the Big Bang. From 10^-37 to 10^-35 seconds. It produced a false vacuum which produced a neg. pressure repulsing gravitons to make the cosmological constant increase the size of the universe by a factor of 10^30.



First order phase transition discontinuities in the inflation universe

The first series of applications out elementary catastrophe theory deals with thermodynamics phase transition Ginzburg Landau second order phase transition
we relate the critical point of the fluid to the cusp catastrophe and also relate this to inflationary universe by Alan

Classical theory phase transition is naturally related to elementary catastrophe dairy. The general family of potential functions depending on  a in state variables or parameters.

We left the state of the physical system be described by the value X that minimizes the potential locally. The physical system is then reduced to a study of equilibrium and stability properties of the potential function V(x,c).

The first derivative of the function is equal to zero at equilibrium and the second are shown the river it is greater than zero indicating a local stability as well as the critical values of the stable equilibrium branches.

In general the potential function the will have only isolated critical points. A phase transition occurs when the point asked of scribing this state of the physical system jams from one critical branch to another.

Phase transitions can I curve when the control parameters are varied. The control parameters are assumed to depend upon a single time parameter. A phase transition will occur when the curve crosses and appropriate point. The bifurcation set on which the local minimum are created or destroyed for this curve the transition is of order and if the limits of the derivative goes to zero. Phase transitions in nature usually orange zero first or second order.


ECT

A ‘singularity’ is a point where mathematical models are no longer valid ‒ for example: a point divided by zero is undefined. The theory of singularities examines mathematical manifolds in an abstract space to gain a topological representation of the region near a singularity.

In the 1960’s Rene’ Thom proposed a nonlinear mathematics approach to describe singularities called Catastrophe Theory. Thom classified the bifurcations based upon their potential function and its derivatives. The morphology of solutions is determined by values of the potential’s parameters. In the special case of gradient vector fields a rigorous mathematics results called Elementary Catastrophe Theory (ECT).

Gradient vector fields are interesting because nearly all trajectories on the behavior surface tend toward a point attractor and the attractor minimizes the potential function V of the system. The parameters determine the locations of the relative minima. A smooth change in the parameters can give rise to a discontinuous jump on the behavior surface.

Thom found that under stable conditions there are exactly seven elementary catastrophes if the potential function has no more than two parameters. The most illustrative is the Cusp Catastrophe with a potential of:

V(x, a, b) = (x^4)/4 + A(x^2)/2 + Bx.

The Cusp has two control variables A and B where x satisfies

dV/dx = 0,

shown in figure 1.

Outside the cusp region there is only one extrema value for x. Inside the cusp, there are two different values of x giving local minima of V(x) for each.

Cusp shape in parameter space (A, B) near the catastrophe point shows the locus of fold bifurcations separating the region with two stable solutions from the region with one.

But the bifurcation curve loops back on itself, giving a second branch where the alternate solution loses stability and jumps back to the original solution space. You can observe hysteresis loops as the system follows one solution and jumps to the other [1].



Figure 1 Cusp Catastrophe

Consider if one holds B constant and varies A to follow path 1 or 2. In the symmetrical case B = 0, a pitchfork bifurcation occurs as A is reduced. One stable solution suddenly splitting into two stable solutions and one unstable solution as the physical system passes to A < 0 through the cusp point (0,0) (spontaneous symmetry breaking). Away from the cusp point, there are no sudden changes.

References Alesso [2-5] illustrate Elementary Catastrophe Theory applications.

REFERENCES:

[1] Weinberg, S., "The First Three Minutes," Basic Books, NY, NY, 1977.

[2] Guth, A. H., "The Inflationary Universe," Basic Books, NY, NY, 1997.


[3] Wikipedia: Catastrophe Theory

[4] Alesso, H. P., “On the Instabilities of an Externally Loaded Shell” INTERNATIONAL JOURNAL OF NONLINEAR MECHANICS, Vol. 17, No. 2, pp-85-103,1982.

[5] Alesso, H. P., and Smith, C. F., “On the Classifying the Deformation Shape of the Liquid Drop Model” IL NUOVO CIMENTO, Vol. 66, pp 272-282, 1981.

[6] Alesso, H. P., “Elementary Catastrophe Modeling of an End-Loaded Ring In a Rigid Cavity” NUCLEAR ENGINEERING AND DESIGN, 1978.

Monday, February 22, 2010

Singularity Metrics: Manycore Processors

As the billions of smart devices using single microprocessors are replaced by manycore ‘brains,’ we can expect to reach trillions of smart chips conducting much more efficient parallel processing within just seven years. The Era of Moore’s Law will give way to the Era of Amdahl’s Law [1].

During the Era of Moore’s Law, miniaturized microprocessors produced smaller faster computers. Manycore systems are now replacing the performance hierarchy with innovative efficiency thereby redefining the Information Revolution.

Moore’s Law is the empirical observation that the capacity of chips doubles every 18 months. As physical size of chips grew, the density and complexity of the circuits increased. In 2002, Intel planned on achieving 30-gigahertz chips by today using 10 nanometers technology. But Intel was wrong.

Chip makers are still using four gigahertz, and the future has shifted from obtaining greater single processor to exploiting manycore processors.

Manycore processors provide high density computer processing power with scalability and less heat. Just as the transistor replaced the vacuum tube, manycore systems are now replacing the single microprocessor system, as more efficient, cheaper, and more reliable components.

Conventional wisdom for PCs predicates a doubling of the number of cores on a chip for each new silicon generation. Within a few years there will be 100 core machines. Applications will require new concurrent programs. Windows 7 and Windows Server 2008 can now work with up to 256 logical processors. There is conviction that reaching 1000 cores on a die with 30nm technology is possible. Cisco already has routers with 188 cores through using 130 nm technologies (see Figure 1).

The goal is easy-to-write programs executing efficiently on highly parallel systems using 1000s of cores per chip.

This means that growing software complexity will require fundamentally rethinking architecture and shifting the paradigm from Moore’s Law to Amdahl’s Law.

Amdahl’s Law given by:

Speedup ≤ 1 / (F + (1-F) / N)




Figure 1

Amdahl's law describes how much a program can theoretically be sped up by additional computing resources, based the proportion of parallelizable and serial components. Where F is the fraction of calculation that must be executed serially given as [2]:

F = s / (s + p)

where s = serial execution and p = parallel execution.

Then Amdahl's law says that on a machine with N processors, as N approaches infinity, the maximum speedup converges to

1/F, or (s + p)/s.

What does this mean for the metrics technology growth?

It means fast just got faster.

REFERENCES:

1. Alesso, H. P., Connections: Patterns of Discovery, John Wiley & Sons Inc., New York, NY, 2008.

2. Goetz, B., et. al., Java: Concurrency in Practice, Addison-Wesley, Stoughton, Massachusetts, USA, 2008.

Sunday, May 3, 2009

Electronic Medical Records

The 2009 Federal Stimulus Package devotes $20 billion dollars to electron medical records and another $7.2 billion to broadband Internet access. The spending is unprecedented not only on scale, but also on breath of technology. There is $17.6 billion allocated for incentive payments to health-care providers who adopt electronic health records and $2 billion for coordinating information technology.

This financing is intended to move health care to a new level of quality as well as cost containment.

The healthcare industry exists to heal the human body when it becomes ill. But it needs assistance to overcome inefficient, manual, paper-based processes by automating methods utilizing collaboration, electronic forms, and enhanced patient care.

Automate information capture through electronic registration, health histories, consent forms, and disclosure forms could streamline the entry process. A nurse or administrator can verify health data extract data to electronic medical record (EMR) systems. Then trigger other processes such as billing or scheduling automatically. As a patient's medical record evolves over time, content can be consolidated into a single secure file.

An Electronic Medical Record (EMR) is an electronic record of health-related information on an individual created by authorized staff within one health care organization.

An Electronic Health Record (HER) is an electronic record of health-related information on an individual that conforms to nationally recognized interoperability standards that is managed by authorized staff across more than one health care organization.

A Personal Health Record (PHR) is an electronic record of health-related information on an individual that conforms to nationally recognized interoperability standards and that can be drawn from multiple sources.

The goal is to leverage industry standards and integrate them with enterprise documentation systems through EMR, HER and PHR.

Of the more than 800,000 clinicians in the US, only 17% have EHRs today. This leaves 664,000 who need EHRs. Over the next 5 years the early adopters will gain the full stimulus incentive amounts available in 2011-2012.

There are over 100 companies developing EHRs such as the market leaders are eClinicalWorks, Allscripts, NextGen, GE Centricity, and Meditech/LSS.

One of the most cost effect information technology upgrades for addressing the voluminous data intensive mega-file healthcare records is through parallel processing. We can expect to see tremendous innovation in this area.

Sunday, March 29, 2009

Primer on PLINQ

In this presentation, we present a primer on LINQ and then we extended its reach to the parallel version Parallel Language Integrated Query (or Parallel LINQ). Parallel LINQ (PLINQ) provides Declarative data parallelism through the ParallelEnumerable and ParallelQuery Classes. We concentrate on the ParallelQuery Class which has two methods (AsParallel, AsSequential).

Language Integrated Query (LINQ) is a special kind of search that locates data from various data sources. LINQ shortens queries while simplifying connecting to a variety of data source. It is all about searching efficiently and consistently with less effort. LINQ searches an array as one searches a Structured Query Language (SQL) server. It divides queries into four common types: LINQ-to-Object and LINQ-to-XML (which we will find also support PLINQ), as well as, LINQ-to-Dataset and LINQ-to-SQL.

The NET Framework LINQ namespaces create a different kind of data connection. The System.Linq namespace contains all the basic classes for LINQ and the System.Linq.Expressions namespace contains the classes, interfaces, and enumerations used to create expressions.

The three Stages in a Query Operation are

1/. Get the data source. If the source is an array you must declare the array and assign values.
2/. Define the query expression
3/. Execute the query to return the results.

For example, a LINQ query that retrieves data from an array would show these three stages as:

int[] nums = new int[] { 0, 4, 2, 6, 3, 8, 3, 0, 4, 2, 1 };

var result = from n in nums
where n < 5
orderby n
select n;

foreach (int i in result)

The standard LINQ operators consist of a collection of 50 methods that define extension methods on the static Enumerable and Queryable classes from the System.Linq namespace. The operators fall into one of two categories: for deferred execution of a query where the query will not execute until you consume the results, and Other operators will execute a query immediately.

LINQ uses keywords for making a query. They tell LINQ what to search for, starting with defining the from and in keywords. The where, orderby, join, and let provide additional conditions. A LINQ query requires four lines. First a variable that holds the query. An Enumerator object to select individual query values. The var keyword identifies the query variable. For example:

var MyQuery =
from StringValue
in QueryString
select StringValue;

Parallel LINQ (PLINQ) forms declarative data parallelism. Parallel Language Integrated Query (PLINQ) uses System.Linq namespace in the System.Threading.dll assembly. LINQ's declarative nature provides the flexibility for a clever implementation of PLINQ to use parallelization. PLINQ extends LINQ developers to use multiple cores for their LINQ expressions by running any LINQ-to-objects query using data parallelism. PLINQ fully supports all .NET query operators and the existing LINQ model.

PLINQ uses two classes:

 The ParallelEnumerable method exposed through System.Linq.ParallelEnumerable Class
 The AsParallel method exposed through System.Linq.ParallelQuery Class

PLINQ is a query execution engine that accepts any LINQ-to-Objects or LINQ-to-XML query and automatically utilizes multiple processors or cores for execution when they are available. The change in programming model is tiny, meaning you don't need to be a concurrency guru to use it.

With PLINQ you don't need to move your entire database server processing logic over to in-memory LINQ-to-Objects queries in the client. Instead, PLINQ offers an incremental way of using parallelism for existing solutions.

Internally, PLINQ uses Tasks and the parallelizing query gets processed by multiple threads. Preserving the order is an extra step that gives up some of the performance gains.

The following Listing expanding on an example provides an AsParallel methods for finding prime numbers in a loop using PLINQ based upon an example provided by Steven Toub.

Counting Prime Numbers In For Loop

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Xml;
using System.Diagnostics;
using System.Threading;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
while (true)
{
Console.WriteLine(Time(delegate
{
Queue primes = new Queue();

for (int i = 0; i < 2000000; i++)
{
if (CheckPrime(i)) primes.Enqueue(i);

}
}));

Console.WriteLine(Time(delegate
{
Queue primes = new Queue();
Parallel.For(0, 2000000, i =>
{
if (CheckPrime(i)) primes.Enqueue(i);

});
}));
Console.ReadLine();
}
}

private static bool CheckPrime(int p)
{
if (p < 2) return false;
int upperBound = (int)Math.Sqrt(p);
for (int i = 2; i <= upperBound; i++)
{
if (p % i == 0) return false;
}
return true;
}

static TimeSpan Time(Action a)
{
Stopwatch sw = Stopwatch.StartNew();
a();
return sw.Elapsed;
}

}
}

SUMMARY

In this presentation, we began with a primer on LINQ and then we extended its reach to the parallel version Parallel Language Integrated Query (or Parallel LINQ). Parallel LINQ (PLINQ) provides Declarative data parallelism through the ParallelEnumerable and ParallelQuery Classes. We concentrated on the ParallelQuery Class which has two methods (AsParallel, AsSequential) and provide applications to demonstrate its capabilities.

REFERENCES

[1] Alesso, H. P. and Smith, C. F., Connections: Patterns of Discovery, John Wiley & Sons Inc., New York, NY, 2007.

[2] Alesso, H. P. and Smith, C. F., Thinking on the Web: Berners-lee, Turing and Godel, John Wiley & Sons, Inc. 2008.

[3] Microsoft Visual Studio 2010

Thursday, January 15, 2009

C# Concurrent Programming

Concurrent Programming is being developed to be scalable and produce high performance as manycore hardware systems are now being released for PCs, routers, and small devices. Programming for parallel processing will require optimizing multiple task execution.

Microsoft is planning on releasing concurrent programming tools for windows developers as fast as they can.

The Windows and .NET Framework platforms currently offer threading support for scheduling performance, synchronization AI, and memory hierarchy awareness. Microsoft’s Visual Studio 2010 will add concurrency at the library level for native as well as managed .NET languages.

Traditionally programming languages perform computations using syntax and semantic rules based upon the basic constructs: sequential statements, looping, branching and hierarchical organization. For C# managed code Microsoft has developed a Task Class, a Parallel Class, and a Enumerable Class to take advantage of these constructs for optimizing and simplifying concurrent programming.

Amdahl’s Law applies directly to the optimization of serial and parallel operations performed by software including branching (If, switch, etc.) operations and looping (do, for, and foreach) operations in programs where repetitious operations offer efficient points for concurrent programming methods.

While Microsoft has supported threading operations for many years thread have many hazards associated with simultaneous access of shared memory by different threads. This can lead to hazards that arise from competing threads that jeopardize state management including: deadlocks, livelocks, and race conditions. The next generation of Visual Studio 2010 tools addresses these difficulties.

As a result, Microsoft has developed a Task Program Library to exploits concurrency in program operations without the complexity and error prone direct exposure to threads. In addition, Microsoft’s implementation of these features optimizes core utilization while minimizing complexity.

The following Figure show the Visual Studio 2010 model for building parallel tasks for managed and native code on top of both threads and thread pools.



Figure: Visual Studio 2010 Programming Model

Parallel Extensions for .NET 3.5 provides library-based support for concurrency with any .NET language, such as C++, C# and Visual Basic. It includes: Task Parallel Library, Parallel LINQ, and parallel method extensions.

Visual Studio 2010 and .NET 4.0 provide these extensions in the form of a library for rapid development:

 Task Parallel Library (TPL)
 Imperative task parallelism – Task Class
 Imperative data parallelism – Parallel Class (Parallel.For)
 Parallel LINQ (PLINQ)
 Declarative data parallelism – ParallelEnumerable and AsParallel Class

The Task Parallel Library (TPL) provides support for imperative data and task parallelism. The Task Parallel Library (TPL) makes it easy to add data and task parallelization to an application.

Parallel LINQ (PLINQ) provides support for declarative data parallelism. PLINQ is an extension of LINQ where the query is run in parallel. PLINQ takes advantage of TPL by taking query iterations and assigning work units to threads (typically processor cores). Adding concurrent programming capabilities to LINQ is a natural extension of LINQ.

Coordination Data Structures (CDS) provide support for work coordination and managing shared state.

The .NET application developers can look forward to the release of Visual Studio 2010 for the tools and techniques to write simple efficient thread-safe code for manycore systems.

[1] Alesso, H. P. and Smith, C. F., Connections: Patterns of Discovery, John Wiley & Sons Inc., New York, NY, 2007.

[2] Alesso, H. P. and Smith, C. F., Thinking on the Web: Berners-lee, Turing and Godel, John Wiley & Sons, Inc. 2008.

[3] Microsoft Visual Studio 2010

Sunday, November 9, 2008

The Era of Amdahl’s Law

Today, the transition is being made from the individual knowledge worker in the Era of Moore’s Law to the collective Web workers in the Era of Amdahl’s Law where Web workers create, sort, search, and manage information between knowledge products, devices, and people.

While corporations were seeking to increase each individual’s productivity in the Era of Moore’s Law, now distributed groups working in parallel are reaping the benefits of plummeting transaction costs over the Web.

In 2005, IBM's announcement that it had doubled the performance of the world's fastest computer, named Blue Gene/L from 136.8 trillion calculations per second (teraflops) to 280.6 teraflops. The Blue Gene system is the new generation of a massively parallel supercomputer in the IBM System Blue Gene Solution series: the epitome of centralized computer power.

At the other end of the scale, Google has developed the largest parallelized computer complex in the world, by inventing their own Googleware technology for parallel processing across distributed servers, microchips, and databases.

As a result, parallel processing is effecting all aspects of the Information Revolution: the mainframe computers have become supercomputers with massively parallel microchip configurations; the individual personal computers of the Era of Moore’s Law have become multicore processors for application processing, and the Web is utilizing applications such as Googleware based upon a vast parallelized computer complex with its specialized concurrent programming.

Parallel processing has infiltrated all aspects of computer usage because the limitations of Moore’s Law require compensation through Amdahl’s Law given by:

Speedup ≤ 1 / (F + (1-F) / N)

Amdahl's law describes how much a program can theoretically be sped up by additional computing resources, based the proportion of parallelizable and serial components. Where F is the fraction of calculation that must be executed serially given as:

F = s / (s + p)

where s = serial execution and p=parallel execution.

Then Amdahl's law says that on a machine with N processors, the maximum speedup is given by:


As N approaches infinity, the maximum speedup converges to 1/F, or (s + p)/s.

This means that a program with fifty percent of the processing executed serially, the sped up is only a factor of two, regardless of how many processors are available. For a program where ten percent must be executed serially a factor of ten is the maximum sped up.

All computer applications must now being translated from sequential programming into parallel processing methods. As a result, the third wave of computing has become the Era of Amdahl’s Law where the information environment of each person is connected through the Web to a variety of multicore devices.

Manycore systems hold the promise of 10 to 100 times the processing power in the next few years. However, as software developer’s transition from writing serial programs to writing parallel programs there will be pitfalls to creating robust and efficient parallel code.

Even if current applications don't have much parallel functionality, s and p can be changed:

1. Increase p by doing more of the same: Increase the volume of data processed by the parts that are parallelizable. This is Gustafson's Law.

2. Increase p by doing adding new features that are parallelizable.

3. Reduce s by pipelining.

If we keep run time constant and focus instead on increasing the problem size, the total work in a fixed time:

Total Work = s + N * p


Besides solving bigger versions of the same problem, we also have the option of adding new features.

Normally, getting just N-fold speedups is considered the Holy Grail, but there are ways to leverage data locality and/or perform speculative and cancelable execution to set up super linear speedups.

References:

[1] Alesso, H. P. and Smith, C. F., Connections: Patterns of Discovery, John Wiley & Sons Inc., New York, NY, 2007.

[2] Sutter, H., Break Amdahl’s Law!, Dr. Dobb’s Portal, Jan. 17, 2008.

[3] Goetz, B., et. al., Java: Concurrency in Practice, Addison-Wesley, Stoughton, Massachusetts, USA, 2008.

Sunday, August 10, 2008

Concurrent Programming

Mighty oaks from tiny acorns grow or so an ancient proverb claims — consider the microchip. Smaller than a penny, it is the brain of every digital device in the world. Chips connect circuits, computers, handheld devices as well as satellites and an endless list of electronics. As the centerpiece of the information revolution, the chip is the driving force behind innovation as it follows an ambiguous rule called ‘Moore’s Law.’

In 1965, Gordon Moore who shared in the invention of the microprocessor chip and went on to co-found the Intel Corporation wrote an article where he noted that the density of components on semiconductor chips had doubled yearly since 1959. This annual doubling in component density amounted to an exponential growth rate, widely known as Moore's Law.

While Moore’s Law is not a physical law, like gravity, it is an empirical observation that the capacity of memory chips has risen from one thousand bits in 1971 to one million bits in 1991 and to one billion bits by 2001. The billion-bit semiconductor memory chip represented an extraordinary nine orders of magnitude in growth, and a similar growth rate has also been seen in the capability of microprocessor chips to process data.

While many have speculated on the future of Moore’s law, some have concluded that instead of focusing on obtaining greater speed from of a single processor, innovators should develop multi-core processors. Instead of scaling clock speed, which produces power usage and heat emission to unacceptable levels, in order to increase processing power, chip manufacturers have begun adding additional CPUs, or “cores” to the microprocessor package. By working in parallel, the total 'throughput' of the device is increased. Quad cores are already being produced commercially. The advances in parallel hardware development require similar advances in optimizing the execution of multiple tasks working in parallel, called Concurrent Programming.

While on a single core computer can use multithreads to parallelize processes, true processing parallelism doesn't occur without multi-CPU's. Distributed computing uses parallel work units distributed across numerous machines. However, distributed computing incurs additional requirements for task management.

Concurrent programming utilizes task management and communication. The task manager distributes work units to available threads while task communication uses state and memory sharing to establish the initial parameters for a task and collects the result of the task's work. Task communication requires locking mechanisms to insure performance gains, prevent subtle bugs as multiple tasks overwrite memory locations. Synchronization of state and memory issues can be controlled by using locks, monitors, and other techniques to block threads from altering state another makes changes.

Microsoft’s Parallel Computing Development Center provides support for parallelism, programming models, libraries and tools with F#, Task Parallel Library (TP), Parallel Extensions Assembly (PFX), and PLINQ.

F# is a typed functional programming language for the .NET framework that does not directly support concurrent programming. However, it does include asynchronous workflows for I/O. TPL is designed assist in writing managed code for multiple processors. PFX is being folded into TPL. PLINQ is LINQ where the query is run in parallel. PLINQ takes advantage of TPL by taking query iterations and assigning work units to threads (typically processor cores).

Collectively these efforts help the .NET Parallel class to ease the development of threaded applications. Nevertheless, state and shared memory issues are left to the programmer to solve. Adding concurrent programming capabilities to LINQ seems a natural extension of LINQ.

As a result, the next series of technological advances in the information revolution will be strongly dependent on concurrent programming.

Threads

Today work items are run by creating Threads such as:

Thread t = new Thread(DoSomeWorkMethod);
t.Start(someInputValue);

For 10 work items, we could create 10 threads, but this is not ideal because of context switching, and invalidation of each thread’s cache and memory for each thread’s stack. An alternative is to use the .NET ThreadPool class:

ThreadPool.QueueUserWorkItem(
DoSomeWorkMethod, someInputValue);

However, this lacks the richness of the full API since we do not get a reference to it and there is no explicit support to know when it is completed.

Parallel Extensions is a new class similar to Thread with semantics close to ThreadPool. A code snippet for the new Task class is:

Task t = Task.Create(DoSomeWorkMethod,
someInputValue);

See References for further material.


REFERENCES

[1] Alesso, H. P. and Smith, C. F., Connections: Patterns of Discovery, John Wiley & Sons Inc., New York, NY, 2007.

[2] Clifton, M. “Concurrent Programming - A Primer” 3 Jan 2008


[3] Microsoft - Concurrent Programming 2008.

[4] Moth, D., Parallel Extensions to the .NET Framework, 28 February 2008.