processor programming architecture

 

Overview

this covers some basic knowledge needed to get started in parallel programming, which is the art of having multiple functions executing at the same time, either synchronously or asynchronously. usually asynchronously (meaning, not at the same time).

cpu programming architecture levels

There are 4 levels of granularity for process handling when it comes to parallel programming:

  1. processor. if you have several of these on 1 board, you have SMP (Symmetric Multi-Processing). can hold multiple cores possibly.
  2. core. functionally like a processor, but shrunk down and multiplied on a single silicon die. can execute multiple threads possibly. google chrome makes use of multiple of these without locking. problem comes if you try to lock them all and try to do something else at same time. your machine slows to a crawl or doesn't respond.
  3. thread. windows likes to interpret these as processors for some reason, which is OK with me. :-) (individual function call, a functional unit/section of code with a name. you feed the name to the create thread function and it creates the thread. when the individual function exits, it's over. you can tell it's over by using some native function calls like WaitForMultipleObjects()). multithreaded programming is being done more and more, especially with archiving/unarchiving, encoding/decoding, and with regular windows apps for enhanced responsiveness of UI. mediacoder and adobe media encoder and video editing apps can make use of multiple of these. problem comes if you try to lock them all and try to do something else at same time. your machine slows to a crawl or doesn't respond. mediacoder locks them, adobe doesn't.
  4. fiber. (I forget what this is, google it) hardly anyone does fiber programming.

usually today's average processor has 2-4 threads per core and multiple cores (some procs like the Intel E7 currently have 30 threads). if you have a specific processor model number, you can look it up at intel.com or amd.com and verify the number of threads and cores and other things you need to know, like how much memory it can address. no processor I have found yet can address the full 64 bits of address space (IA64?): the number of motherboard traces required to have any speed would be tremendous. currently (6/5/2012) mobos are at 256 lines.