olivier deheurles

Just another programming weblog

Archive for the 'Blog' Category

Hardware, Parallel computing and stuff…

About one month ago I watched a video describing the architecture of LMAX (Financial Exchange) and realized that I did not know that much about hardware. I made some researches and found really good documents, blogs and videos and I thought it may be a good idea to share my findings…

First I would recommend to have a look at LMAX - How to Do 100K TPS at Less than 1ms Latency presented by Martin Thompson and Michael Barker, in about one hour it gives a pretty good overview of the challenges you have to face when building a HPC system with high level of contended concurrency. Comments below the video also worth having a look to get more details on there architecture.

Then there is an excellent paper from Ulrich Drepper (Red Hat): What Every Programmer Should Know About Memory. It presents current commodity hardware architectures focusing on :

  • RAM - don’t be afraid by this first part, you can skip most of it,
  • CPU Caches, cache coherency protocols, etc. – very interesting and important to understand too
  • Virtual memory
  • the second half of the document focuses on “what programmers can do” (must read) and “Memory performance tools” (relevant if you are working on Linux systems).

Paul E. McKenney, working on Linux kernel, is writing a book on parallel programing: Is Parallel Programming Hard, And, If So, What Can You Do About It? I won’t give a feedback yet because I’ve not yet finished it yet but I can already say that it’s really worth reading.

I have read as well several white papers from Herb Sutter (one of the C++ big names), you can find them on his web site, in his books and articles section. If you prefer videos there is “Machine Architecture: Things Your Programming Language Never Told You video on YouTube with corresponding pdf slides.

Interested by parallel programming and wants to learn more about wait-free, lock-free, obstruction free, etc.? If you are, you should really go on Dmitry Vyukov’s website 1024cores and read the introduction and articles in order, they are pretty quick to read but very informative. You will find as well lots of algorithms and data structures for parallel programming – MUST READ. You should subscribe to it’s blog as well.

All documents and videos above are presented from the perspective of Linux/C++/Java but are very relevant even for a Windows/.NET developer.

Now if you want to learn more about Windows and .NET I would recommend:

  • Joe Duffy’s blog and book are must read for parallel programming on Windows,
  • Interested by internals of .NET Garbage collector? Maoni Stephens, working on the GC, presents latest evolutions of the .NET 4 GC in a Channel9 video, read here blog for more details.
  • Patrick Dussud, one of the Microsoft Technical Fellows, and one of the CLR founders and chief architect of the .NET Garbage Collector, has some videos on the .NET GC internals here and here. You will notice that I’m not the only French guy with an horrible English accent ;)
  • I’ve downloaded as well the open source code of the .NET platform (Rotor). You should really have a look. For instance you can find the C++ source code of the execution engine (\sscli20\clr\src\vm) and the corresponding BCL code in .NET (\sscli20\clr\src\bcl\system). Did you ever wondered how .NET objects are stored internally? Where is the implementation of “extern” methods for the BCL classes? It’s there! The document Object Internals is a good companion to start browsing this large code base.
  • CLR: Vance Morrison blog and Jeffrey Richter’s blog and book CLR via CSharp
  • Windows internals: Mark Russinovich, Technical Fellow and Windows Kernel guru, has a good video “Inside Windows 7” on Channel9 and his book Windows Internals, the absolute reference for Windows’ OS core.

Other interesting stuff to read:

  • Ring Buffer implementations (CPU Cache friendly + optimisations): MCRingBuffer and LibertyQueue white papers,
  • False sharing: here and here (Herb Sutter strikes back)

Last thing to say: I’ve been reading quite a lot lately and it’s pretty hard to keep track of what you have read, what you would like to read, etc.

  • I’ve found Read It Later service extremely useful: it integrates with your browser  (Chrome for me), a single click and you have added a document to your list of stuff to read and your mobile devices (iPhone, iPad for me) get synchronized automatically. It works quite well for HTML pages.
  • For PDFs on Ipad/iPhone, GoodReader is a must. Note that it can connect to your DropBox if you have one, very useful to share documents between devices.

Enjoy…

No comments

Now what ?

I’m Ready !

My blog is now set up and I plan to write some articles on the following subjects :

  • How to set-up and design a web site build by multiple teams with independent deployments,
  • How to design an AJAX Web site with HTTP streaming (Lightstreamer),
  • How to design a build environment : build, unit tests, deployment and integration tests for an ASP.NET web site with Selenium RC,
  • Why Resharper is TDD’s best friend.
Comments are off for this post

Library

After spending quite a lot of time arranging and completing my book list, I asked myself if there was not a WordPress plug-in which can manage this for me. After 5 minutes on google I found not just what I was looking for, but really better. The plug in is named Now Reading and have the following functionalities:

  • add books by ISBN and automatically retrieve book informations on Amazon (great),
  • provide a library page visible on the blog,
  • fully manageable book list in WordPress administration section,
  • I can edit reviews of the books, rate them
  • manage list of read, currently reading and planned books.

The library is available here and in the menu on the right.

No comments

Syntax highlighting

Since there are good chances that I post code samples in the blog, I wanted a good way to format them and I think I found one. There’s a WordPress plug-in which uses this Syntax Highlighter written in JavaScript (the Highlight occurs client-side).

For my personal use, a good syntax highlighter should :

  • be easy to use, I don’t want to have to make lots of manipulations to output a well formatted code,
  • allow easy editing : if my code is escaped with lots of HTML tags and CSS, it won’t be very convenient to work with while editing a post,
  • allow visitor to copy paste it, without having the same kind of HTML tags disturbance,
  • support a least C# and XML,
  • output formatted code in RSS.

Let see how this plug-in render :


// Hello1.cs
public class Hello1
{
public static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}

Not too bad. Let’s see with a XML document now :


<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section
name="castle"
type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor" />
</configSections>

<castle>
<components>
</components>
</castle>
</configuration>

Fine !

I just see one problem with that solution : since Syntax Highlight is processed client side (JavaScript), the code will not be highlighted in RSS :-(

I found an other solutions that can do the job : http://www.manoli.net/csharpformat/format.aspx is an online service that can encode source code snippets in HTML. The annoying point with that is that it generates quite a lot of CSS/HTML and I fear the day where I will have to update some piece of code surrounded with 5465451 HTML tags…

Comments are off for this post

WordPress : Why and How ?

Round One : Online Service VS personal blog publishing platform

I read quite a lot of blogs but I must admit than I’ve never looked which tool was behind. After lurking on some of my favorites blogs and some searches on google, I found that there are 2 main ways to make a blog… excluding developing one myself

  • register to an online Blog service, like Blogger, MySpace, etc…
  • or host the blog myself and use a personal blog publishing platform (preferably open source)

The second one is more interesting for me : I can customize it if required, I’ve access to the Database so I can migrate the Blog elsewhere and it allow me to do lots of other geek’s stuff.

Ok, I’ve chosen, I WILL USE THAT ! Mhh, but which one ?

Round Two : .NET/SQL Server VS PHP/MySQL

As I’m a .NET developer, I first tried to find an ASP.NET solution and found the Subtext project (used by one of my favorites blogger : Ayende Rahien ). But this solution did not seem perfect to me :

  • this is not as easy to find a host for an ASP.NET/SQL Server solution than it is for a PHP/MySQL one,
  • I found more mature (more functionalities) and active projects in the PHP/MySQL world.

Final Round : Dotclear VS WordPress

I found two interesting solutions : Dotclear and WordPress. After installing EasyPHP I set up both solutions locally and start playing with them. I’ve to admit that my final decision came quite fast because WordPress is really an impressive product :

  • very intuitive, easy to configure and really smart,
  • the WYSIWYG text editor contains everything required to edit a post and every function can be accessed with a keyboard shortcut,
  • possibility to create pages : these are not included in the blog’s ticket flow but are accessible with the menu. I plan to use them to host more “advanced” documents than simple blog tickets.
  • I found a theme (skin) that i like on Fahlstad site : http://www.fahlstad.se/themes/ (the fspring one)
  • LOTS of plugins
No comments