There’s an article on Computerworld that Microsoft is telling us that multicore chips are changing PC software design, but that not enough people are programming multi-threaded applications to take advantage of this feature.
Let me tell you, writing multi-threaded code is really easy. Writing correct multi-threaded code is the tricky part. Most development frameworks are not Multi-Thread safe. This means that you can’t use it willy-nilly from multiple threads at the same time (it’s primarily a resource assignment issue). So you have one thread that performs all the GUI work. Then you have to coordinate to have either the data or something close to rendered detail for the GUI thread. Then you have a barrage of threads performing various other bits of work. Of course, don’t forget that making an application too multi-threaded has negative effects.
There is a subtle difference between multi-processor and multi-threaded processors which means that an mt-processor isn’t the same functionally as separate cores/processors (shared resources, this being the whole -threading implication behind the name), so just throwing arbitrarily extra work at the mt-processor won’t gain you much. The OS needs to know this information to schedule more intelligently, so adorning the threads with informatiion about the related data-affinity can gain you significant performance boosts (the OS schedules different threads more intelligently). The problem is that you need to export this concept to an application programmer. Guess what, it’s generally too complicated for anything less than the most processor intensive tasks.
Generally, having the extra threads/cores/processors means that you get an overall system performance boost, it’s just that the OS stops the isolation granularity at the process level. Operating systems have been designed around the ‘complicated process, simple thread’ principle. You don’t want to change the balance of complexity moving back into the threads, we’ll just end up with a sub-thread concept, and my head just hurts from that (atoms, quantum elements).
So what does the average joe programmer do? How do you find places that are suitable for parallelizing? How do you then ‘fix’ them up? Well, unless your program needs parallelism in the first place, it’s actually difficult to retrofit it into a pre-existing design.
Well, there’s a ton more stuff on this that I would like to get down, but it’s 2am, and I need to get some sleep. More in the morrow.
Annoying Delphi 2005 OTA issue
Well, this one is just lovely. The first problem is that it does not support introspecting the Environment Option Names. This is annoying, but the next issue makes it even more fun. When we go looking for the options for, for example the package output directory variable (PackageDPLOutput) it looks at the .NET version before looking at the win32 version i.e. it’s got overloaded option names.
Oh well, it will need to be worked around again, I suppose.
Page Style Chooser
I put in the ‘set page style’ options on the right hand side of the page. They seem to work just fine, mind you there is also the choice in the View->Page Style menu option in Firefox. I’m going to have to change some of the styles to make them more fluid.
I like fluid pages – I tend to resize and get annoyed when they only occupy a small portion of the screen.
Typeface based personals
This is something that has always interested me. Certain typefaces cause me to think of certain things, just like certain pieces of music and certain half-seen images. The typeface personals is a collection of personal ads/dates oriented on different type faces. It’s quite a good description, and evokes some of the feeling that you get from looking at them. Then again, I know of at least one person who will think I’m talking a load of w**k.
All I have to say is that the fight between Helvetica and Arial is not over yet!
Straight apostrophes and quote marks did not exist in typefaces until the advent of digital type in the 1980s. It’s a computer thing, not a typographic thing.
Where Caffeine goes to die
Well it had to happen. Energy fiend has the Caffeine Database, it features all my favourites such as Diet Coke (10mg more caffeine per bottle than regular coke!) and Penguin Mints (7mg per pill). Woot! everyone loves the caffeine.
Skeptic
I’ve been bemused by the TV programs such as ‘Most Haunted’ and ‘Most Haunted Live’, where they are claiming to be encountering spirits in places. I think they’re nothing more than cheap entertainment à la ‘The Blair Witch Project’. I can’t see how people can be convinced that these things are true. The mediums they have on the show have knowledge of the locations, they’re playing on the fears of the people there, and they’re good at reading people. It’s a scam, and harmless entertainment. The only problem is that it’s convincing people that this stuff is real.
Movie choices
Well tonight I was thinking of going to see the new Wallace & Grommit movie, but instead I decided to stay in and get some programming done. To that end, I’ve been treated to Hellboy on Sky Movies. It’s a great movie, but you need to appreciate where it’s coming from.
This afternoon I was treated to my sister in the house talking about here ‘killen’. Just like issues with the pronunciation of ‘fillum’ I’d like to say for the record that I’ve stopped correcting people, I just groan inwardly. This coming from the lad who read the ‘curry’man newspaper every week 🙂
Dermot came back from Holidays
and a round of applause… He got engaged. Good for the both of them.
How to steal focus on 2K/XP
You used to use SetForegroundWindow, but that only blinks your window now, this is because stealing focus is evil. It can be done and it’s evil.
You use the AttachThreadInput API call. The process is attach, focus, detach.
AttachThreadInput(GetWindowThreadProcessId( GetForegroundWindow(), NULL), GetCurrentThreadId(), TRUE); SetForegroundWindow(hWnd); AttachThreadInput(GetWindowThreadProcessId( GetForegroundWindow(), NULL), GetCurrentThreadId(), FALSE);
Again, this is doable, the problem is that it’s not good UI design as this will make your window focus even if your application wasn’t in the foreground, which as we all know is a no-no.
Default make rules
The default make rules for solaris are in a configuration file. This file is /usr/share/lib/make/make.rules
gnu make wanders around with the file built in. You use gmake -p to get it’s default rules (and a whole load more besides).