Saturday Apr 12, 2008

Solaris Application Programming

"Solaris Application Programming" by Darryl Gove is an important new book which has just hit the shelves. It is aimed (In my opinion which cost me $60 to formulate) at the programmer coming from another operating system such as Linux or Windows where (s)he had a level of familiarity with the compiler and observability tools that enabled the writing of extremely fast code, fast. If you are at home with all the GCC options but need a high speed introduction to Sun Studio or just want to program closer to the hardware, but don't relish the prospect of attacking the CPU vendor's manuals, then this is for you.

What's in it

Before you can understand the compiler and how to get the best out of it, you have to understand the CPU and memory and this area is dealt with both for SPARC and x64 straight away. This is followed by the obligatory chapter on the observability tools provided with Solaris - essential reading if you are new around here but not so if you have the POD Book to hand.

Then comes the meat of the book - using the Sun Studio compiler to make computationally intensive code run fast. The target language is C, with forays into C++ and Fortran where necessarily. There is good coverage of floating point, fun with cache lines and the SIMD (on x64) and VIS (on SPARC) instruction sets. The CPU performance counter metrics for both those chips and how to utilise them are thoroughly examined - they provide the data but you have to turn that into information and the material here jumpstarts that process of understanding. There's a section on manually optimising code, caveated that much of what the books in this area teach you has also been taught to the compiler too and in many cases it can do that stuff better than you.

The final section of the book peels off from traditional sequential programming to the parallel model covering multiprocessor machines and multicore processors (CMT). In discussing this, the libraries to take advantage of the hardware capabilities are taken one by one - System V IPC, MPI, Pthreads and OpenMP.

What's not in it

As the title says, its about Solaris application programmming. Its about making code run fast. So it is not a lesson on the APIs available to the programmer - for that you have to go and read Rich Teer or Rich Stevens. Its not about the operating system (that's already covered off in McDougall and Mauro) or system performance, observability and debugging, which they (with Brendan Gregg) have also amply illuminated.

When you read the code samples in the book, you'll notice they perform almost no I/O - indeed use almost no system calls other than to get timings and output them to you the reader. By concentrating on a core subject in this way and keeping the code entirely focused Darryl enables the reader to become amazingly proficient in an area traditionally labelled "guru" (how I hate that word) in 446 pages - that is a huge achievment. If I have nits they are that there is no bibliography (There is a single footnote referenceing a single manpage) and the code is not provided for the all the examples that are run but this is minor chaff. I'd also note that you have to be able to read, or be prepared to learn to read, assembly language for the x64 and SPARC. But you know that anyway.

Where to find out more

The Wiki page for the book is here and I would expect to see downloadable source there some day. Darryl's blog is here.


I can't commend this book highly enough. Every topic that Darryl addresses, he does so with enough detail to get you up, running and proficient, but not so much detail that the going gets bogged down. Its a fine line and the call has been made right every time. If you know what you are doing in a programming environment, just not this one - then this book really is for you. Similarly if you have been playing the Solaris game for a while and are anxious to proceed to the next level, go buy!

Friday Dec 08, 2006

Welcome France 24

France 24, a 24 hour news channel in French, English and Arabic, broadcast over terrestrial digital TV, satelite and the net, has been launched. It has arrived at the behest of Jacques Chirac to provide a French view on the world - He was rather annoyed at the predominance of the Anglo-Saxon news coverage of the Gulf War, for instance. For me, the arrival of this station is really good news (excuse the pun) as I'm trying to learn French and have been limited to output such as Radio France International which, although very good, is a lot less fun than 24 hour rolling news and comment for francophones and francophiles. Also, to some extent I share M. Chirac's reservations about global news media - though I do have some minor observations about France 24:

The logo. I think it very amusing that this is so close to being the negative of the logo of that great American firm, AT&T (See below, all trademarks are copyright know the rest):

France 24 Logo

AT & T Logo

The Presenters. One can detect a certain ageism/sexism in the choice of staff. There seem to be two sorts:

Britney Spears

Prototype France 24 Presenter

I hope that I am mistaken and the female staff will be allowed to age gracefully facing the camera with their surviving male colleagues.

The news loop. Its understandable - its only their second day and they rely largely on feeds from other agencies and networks but even with my short attention span I realised I was watching the same content twice. A slightly longer loop would be nice.

The big issue: The Technology. If you have Microsoft Windows Internet Explorer 7 and Windows Media Player 9 then you are in for a real treat. If you use any other browser (I tried Mozilla and a newer Firefox) you are in for an incoherent mess that looks like this.

And as for my Solaris and Linux platforms? One life is too short to blend this site into the viewing experience of those operating systems. I hope that there are other people out there that have given or will give a fragment of theirs to this cause and could offer me guidance. For those who only want the video feed via Realplayer,


is the key, which is not immediately obvious, buried in the HTML source.

Optimisation for only one platform at this stage in the life of the channel seems an obvious decision: they are only 2 days old. On the other hand, there is no love loss between the French government and the evil empire of American IT corporations - France is developing a "Google rival" and has also taken a swipe at Apple. Microsoft has been mired in European Union anti-trust litigation for years.

Perhaps this emnity will bear fruit for those viewers amongst us who do not drink entirely from the fountain at Redmond. In the meantime I am profoundly grateful to the French taxpayers and the staff of France 24 for this Christmas gift.

Monday Aug 08, 2005

Queueing Costs Nothing

My boss asked me if there was any training I needed. This is a good sign. Unless of course he is looking for something to pad out my severance package such as a course in bricklaying or preparation for the Microsoft Certified Systems Engineer exams. But, hey, the world will always need bricklayers, right? Anyway I replied drily that I get most of my training from Amazon these days. Which is true but the costs are beginning to match those of training courses. Supply and demand dictates that if you want obscure books on systems modelling you must pay the price? Not necessarily so. Here are some expensive titles, for free.

If you are new to the area, I would say that googling for "Markov Chains" is probably not the best way to start, particularly, if like me, you took a fairly relaxed attitude to your mathematics education. Instead go and read Neil Gunther's quite approachable series of articles at the Teamquest site.

Quantitative System Performance Computer System Analysis Using Queueing Network Models dates back to 1984. No doubt if it was still in print it would cost the far side of sixty bucks. Its still very relevant, cited frequently, and is yours for the patience to download and unzip it. A gentle introduction to the joys of mean value analysis: I commend it to you.

If on the other hand you are slightly better mathematically equipped you might want to jump straight in and get Introduction to Queueing Theory (pdf) by Bob Cooper. This and the sundry others are there for the taking at Myron Hlynka's listings.

By now you may well want to play: WinPEPSY (for Windows-enabled readers) is an implentation of PEPSY-QNS it's a very useful tool for graphically constructing and visualising the parameters for systems of network queues. Here is a screenshot to whet your appetite.





« August 2016