Pages

Thursday, April 26, 2012

The Processing Element (Pel)

Welcome » The NERW Concurrency Model

At the heart of any concurrent system is the idea that several "things" executing at the same time. In the NERW model, the Processing Element (pel) abstracts this idea of execution. A pel executes on a physical computer. The pel does not abstract the computer itself, but instead the thread, task, application process, container, or whatever unit of execution in the computer. In other words, the pel represents the logical aspect of the execution , while the locality aspect of it, the computer, is represented by another NERW element, the Computer Element (or cel).

Concurrency happens when there is more than one pel running at the same time. The pels can execute the same code (as in parallel loops), or different code (as in a concurrent application).

To execute, a pel must reside somewhere. This "somewhere" is represented by the computer element (cel). In general, the CHAOS runtime takes care of assigning an executing pel to a hosting cel. However, the NERW model allows the programmer to specify this assignment at compile time, and even the user to customize this assignment at run time. For example, a pel drawing a circle should be assigned to a cel with access to a graphical display so that the tendered circle can be viewed, while a computational heavy pel should be best assigned to a cel with floating-point capability.

To execute, a pel may need to get the input data from another pel. After execution, it may need to give its resulting data to another pel. This is accomplished via the memory element (mel). In the first case, a pel reads from a mel, and in the second case, writes to a mel. If a read is not possible (due to mel empty or locked), or a write is not possible (due to mel buffer full or locked), a pel has to wait. Thus a pel should only access a mel only at the last moment before need. Another strategy is for a pel to fork a delegate pel to do the mel waiting for it while it continues with other meaningful work.

Pel Implementations

See Pel in NERWous C.


Previous Next Top

Wednesday, April 25, 2012

The NERW Concurrency Model

Welcome

The NERW Concurrency Model extends the traditional von Neumann computing model into concurrent processing. The von Neumann machine consists of 3 elements: (1) a memory to store information, (2) a central processing unit (CPU) to process the information, and (3) a computer to host the first two elements.

The NERW model extends the von Neumann machine in two ways: (1) it gives a concurrency capability to the existing elements, and (2) it adds a fourth element to represent the distributed dimension. The NERW reference model consists of four elements:
  1. The memory element (or mel) for storing and sharing information
  2. The processing element (or pel) for execution on the shared information
  3. The computer element (or cel) to host the mels and pels
  4. The network element (or nerw) for communication between the cels
The original von Neumann machine can be viewed as a simplified case of the NERW Concurrency Model, with only one cel (the CPU) hosting one pel (the single thread) and supporting one mel (the memory unit), without any need for a networking nerw.

A multitasking operating system where a single-core machine time slices its processing unit to handle multiple execution threads is represented in the NERW Concurrency Model as having one cel (the single core CPU), multiple pels (threads), multiple mels (segmented memory), and no networking nerw.

A parallel computer with a multicore processor which allows threads to be executed simultaneously is a step-up in the NERW reference model. Such a system is viewed as having multiple cels (CPU cores), multiple pels (threads or tasks), multiple mels (shared memory), and no networking nerw.

A distributed system where there are multiple computers networked locally or over a wide area (such as over the web or cloud), is the most advanced embodiment of the NERW reference model. Such a system makes use of the nerw element.

While there is a semantic difference between parallel and concurrent, unless a specific parallel or concurrent case is referred to, this blog will use the term concurrent for discussion, since it is the more generic term to describe tasks that can start and end in overlapping time periods.

In this chapter:

Previous Next Top