• Home
  • Blog
  • About
kenneth kiraly

Ring buffers and mirrored memory

12/1/2012

0 Comments

 
I ran across a useful article on how to use virtual memory tricks to mirror ring buffer memory.  This allows one to virtually concatenate non-contiguous memory (which can come in very handy at times).  Part 2 of the article discusses the implementation of the ring buffer on top of the mirrored memory allocator.

You can find the mirrored queue code referenced in the article on github.  (Note that one of the commenters also points out an optimized POSIX-based implementation that is posted on Wikipedia.)
One Ring to Rule them All
0 Comments

Lock-free programming and weakly-ordered CPUs

11/3/2012

 
Picture
This is a nice article regarding weakly-ordered CPUs.  The author has covered a number of other subjects relating to lock-free programming on his site - definitely worth checking out!

How to Write a Spelling Corrector

10/20/2012

 
How to write an efficient spelling corrector in less than one page of code.  (Links to implementations across a variety of languages are included at the end of the article.)

A comparison of hash functions

10/5/2012

 
Peter Kankowski has put together a very interesting comparison of hash functions.  His main question, tests of the various types of hash function algorithms (e.g., multiplicative and complex), and his conclusion are useful and worth reviewing, if you're looking for an appropriate hash function for your application.  As is frequently the case in many areas in design and computing, there are trade-offs (!).

SMC - The State Machine Compiler

9/29/2012

 
I learned about The State Machine Compiler (SMC) tool a few weeks back.  This tool is very useful for auto-generating complete state machine code (and it can generate state machine diagrams as well, using Graphviz).

To use SMC, you simply define your state machine using the SMC input language (which uses a yacc-like syntax), and compile it.  SMC can output the generated state machine pattern class code to a multitude of different languages (C, Java, C++, C#, Python, Perl, and so on - even Javascript!)  The generated code is very loosely coupled with your main application code, which makes it easy to integrate and maintain.  In addition, the output code generated by the tool belongs to you, and you can use/license it as you wish.

The SMC website (http://smc.sourceforge.net/) provides a wealth of information, including documentation, tutorials, FAQs, and so on.  If you are planning on creating a state machine in your code any time soon, it is worth checking out SMC.
SMC Example 2
(Example graph from the SMC website)

Cray T94 vs. NVIDIA GTX680

9/23/2012

 
Cray T94
There's a Cray T94 supercomputer currently up for sale on e-bay.  These machines were pretty amazing - e.g., from the picture of the power requirements plate it looks like this particular T94 requires almost 70kW of power to operate - no wonder Cray offered a liquid-cooled model...!

Comparing the relative compute and power capabilities of the T94 with some state-of-the art technology today, it's interesting to see how far things have advanced.

According to the Cray T90 series announcement document from 1995, the T94 appears to have been one of their "entry-level" offerings at the time (a budget supercomputer!):

U.S. list pricing ranges from $2.5 million to $35 million for the
new CRAY T90 series of parallel vector supercomputer
systems, available in three chassis models:

-  The CRAY T94 model: 1-4 CPUs (1.8-7.2 billion calculations
   per second); 512-1024 million bytes (megabytes) of memory;
   air- or liquid-cooled. U.S. list pricing starts at $2.5 million
   for a one-processor system with 512 megabytes of memory.

-  The CRAY T916 model: 8-16 CPUs (15-30 billion calculations
   per second); 1024-4096 megabytes of memory; liquid-cooled.
   U.S. list pricing starts at $9.5 million for an 8-processor
   system with 1024 megabytes of memory.

-  The CRAY T932 model: 16-32 CPUs (30-60 billion
   calculations per second); 4096-8192 megabytes of memory;
   liquid-cooled. U.S. list pricing starts at $22 million for a 16-
   processor system with 4096 megabytes of memory and goes
   to $30 million for a 32-processor system with 4096
   megabytes of memory, or $35 million for a 32-processor
   system fully configured with 8192 megabytes of memory.

If you take a dual-CPU T94 configuration in mid-1995 (for example), that probably would have set you back almost $5M, and you would have ended up with a whopping 3.6 GFLOPS of computing capability, while using a massive amount of electricity in the process (e.g., about 70kW).

Now compare this to an NVIDIA GTX680 graphic card that you can buy today - for around $500, you can get a card that provides you with over 3000 GFLOPS of computing capability, while drawing just 195W of current.  That's quite a contrast!

There are some other interesting tidbits - from the T94 flyer, it did support an optional SSD (1-4GB), and memory bus-bandwidth-wise, the T94's bandwidth was 100GB/s, whereas today the GTX680's is just shy of 200GB/s.

So the question now is - what will this area look like 20 years hence...?

"Minimalism in an Age of Tremendous Hardware"

9/22/2012

 
Interesting lessons from FORTH.  The author's conclusion is spot-on.

Beginner's guide to watercooling your PC

9/4/2012

 
Watercooling components
lifehacker has a great article that explains how to get into watercooling your PC.

I currently use a closed-loop fixed system (Antec Kuler H2O in a push-pull configuration using a pair of Cooler Master Excaliburs) which works great for my needs.  (But my CPU does still run a little hot when I crank it up to 4.9GHz...hmmm....)

"Just got a shipment of 37 GTX 690's in."

8/25/2012

 
How totally awesome is this?

Inertial scrolling in the early 90s.

8/15/2012

 
Indeed.  (I wonder if Samsung knows about this...)

    Author

    Kenneth Kiraly


    Archives

    June 2013
    December 2012
    November 2012
    October 2012
    September 2012
    August 2012
    July 2012


    Categories

    All
    Computing
    Cool
    Interesting
    Kindle


    RSS Feed




Content copyright (c) 2004-2021 Kenneth Kiraly
All Rights Reserved.