Vista 64 Still Can’t Reliably Kill Processes

November 2nd, 2007

Every release Microsoft promises something that's going to make it so now you can really positively absolutely kill processes that you want to kill.

With Vista, the feature that would help was I/O Cancellation, the ability to cancel an I/O request without having to wait, in case it was hung in the kernel. 

And yet..

C:\Users\stibbett>taskkill /im someapp.exe /f
SUCCESS: The process "someapp.exe" with PID 7020 has been terminated.

C:\Users\stibbett>taskkill /im someapp.exe /f
SUCCESS: The process "someapp.exe" with PID 7020 has been terminated.

C:\Users\stibbett>taskkill /im someapp.exe /f
SUCCESS: The process "someapp.exe" with PID 7020 has been terminated.

C:\Users\stibbett>taskkill /im someapp.exe /f
SUCCESS: The process "someapp.exe" with PID 7020 has been terminated.

I think I'd be less disgruntled if taskkill could just *check* to see if the process is actually gone before gleefully announcing it's success.

Google++

November 1st, 2007

Is this a new development?  I only just ran across this but this is a huge improvement to Google for me:  Google now considers some punctuation part of the word you're searching for and will match only words similarly punctuated.

This is significant for searches like C# and C++, which previously would have been truncated to just the letter "c". 

I tripped across this searching for an update to Spy++, which seems to always hang my box so hard I need to reboot.  I was expecting to have to pepper my search with things like "-espionage" to narrow search down to the topic I wanted, but no, the results were actually relevant to the Spy++ tool.

Alas there's still no update available for Spy++.

Leopard Wireless Broken

October 31st, 2007

If you've updated your MacBook to Leopard and are having wireless troubles, you're not alone.

If you're not into reading the hundreds of messages those threads represent, the gist of it is that if you're using a MacBook Pro and a non-Apple wireless router, your WiFi connection might randomly go away and there's not much you can do about it.  Apple Support doesn't have any answers yet.

Money Comes From the Weirdest Places

October 30th, 2007

Seriously.. I remember seeing presentations on the mobile phone business and how ringtones are so ridiculously huge.  Hundreds of millions of dollars are being spent on these miniscule clips of existing songs (that the buyer has probably already paid for in another format). But that's not news.

What's news to me is how much money Facebook is making off of gifts.  Gifts are basically little pictures you can send to someone with a message.  It's just a row in a database table somewhere, but of course the sentiment behind it can be worth more than that.  Point is, they don't cost Facebook anything to send.

And yet apparently people are buying them like mad.  Check this out:

image

These are all gifts that are "Sold Out", so each of these represents an amount of money Facebook has made off of just selling gifts. 

No Leopard Yet

October 29th, 2007

Apple Canada used Purolator to ship out Leopard, and Purolator seems to be doing a bad job of it.  I haven't gotten mine yet, and there are various reports around the Web of people still waiting.

Apple promised delivery on Friday (release day), and so shipped my copy overnight on Thursday.  It should have been delivered Friday, but it wasn't.  I called Purolator and the lady basically said I couldn't expect overnight delivery from the US.  (um, then why do you call it "Overnight"?).

They do deliver on Saturday, but even though they were late with this shipment, it wasn't scheduled for Saturday delivery, so I'd have to wait until Monday.

Now it's Monday.  I check Purolator's delivery status page and it says:

image

The last line worried me, so I called Purolator.  What they told me is that basically it was on the wrong truck, and that they wouldn't be able to deliver it today.  They did offer to let me pick it up, so tonight I can pick it up from the depot unless it's not there yet.  They weren't able to guarantee it would be at the depot before it closed.

I wish Apple would have used FedEx.

Buying on eBay

October 26th, 2007

Check this out:

Your current bid: US $49.00 (Approximately C $47.40)

Not only is buying on eBay generally a better value for most items than buying them new at retail, because items tend to sell for what they're worth as determined by the marketplace (and an item that's been used even for 10 minutes seems to be worth generally only about 70% what it's worth new), but now that the dollar is better than par, in Canada we have two extra incentives:

The obvious one is we get a break on the dollar. $49 turns into $47.40. Not a big savings but it's better than $49 turning into $75 or more as was the case a few years ago.

And the other one is that buying an item from eBay lets you get it from the states, where you're paying a delta from the American price, instead of a delta from the Canadian price.

If an item loses 30% off it's value after a week of use, and that 30% is off of a price that's already 30% less.. you're looking at a pretty significant difference between Canadian retail and eBay prices. Even after you add shipping.

(You can buy new on eBay as well - usually the eBay price for something new is still a bit less than retail because of lower overhead, and also some price pressure from people selling items they got new and don't need for whatever reason).

Internet based commerce would take over the world, were it not for shipping charges.

Microsoft Must Like Exchanging Xbox’s

October 23rd, 2007

I finally got Xbox #4, after #3 succumbed to the 3 rings of death.  The box they sent me was manufactured September 2006, way before they started building hardware that actually solved this problem.  Maybe I'll get lucky with #5.

“I Am America” Mini Review

October 22nd, 2007

We drove down to Brantford this weekend to visit family, and on the way, listened to Stephen Colbert's book, "I Am America (And So Can You!)".

If you're considering reading this book I'd recommend the audiobook version. It's narrated by Stephen Colbert himself, with some extra voices done by Jon Stewart and a few other recognizable names. There's also background music. It's more like a radio show than an audiobook - a nice surprise.

However good the production value may be, I can't say I really recommend the book.

Here's the problem: It's definitely Colbert's brand of humour, but Colbert's humour can be a bit over the top. It's really best in the Colbert Report format: News and interviews interspersed with little blasts of over the top liberal bashing.

The audiobook is 3.5 hours of over the top with very little news or issues.

Part of what makes what he says funny is that you just don't expect it. An absurd assertion out of the blue is a lot funnier than the hundredth absurd assertion in a continuous stream of them. Perhaps reading the paper book in short sittings would actually be better, because you wouldn't become so desensitized.

It kinda feels like Stephen Colbert does Dave Barry. A lot of people like Dave Barry so maybe we're the ones in left field here. I guess the problem is as regular Daily Show and Colbert Report viewers, we expected more.

Intrinsics

October 19th, 2007

Intrinsics in C++ are places where the compiler knows how to generate code for common C++ operations, including function calls, and does so inline rather than generating a call.

For example, a simple copy of a string from one buffer to another looks like this:

strcpy(dest, src);
00419123 lea eax,[ebp-54h]
00419126 push eax
00419127 lea ecx,[ebp-9Ch]
0041912D push ecx
0041912E call @ILT+1460(_strcpy) (4115B9h)
00419133 add esp,8

This is pushing the source and destination onto the stack, and calling the strcpy function. This is the code Visual C++ 2005 generates in Debug mode. In release mode, with optimization disabled, you get the same code as above. But enable optimizations, and you get this:

strcpy(dest, src);
004015B0 xor eax,eax
004015B2 mov cl,byte ptr [esp+eax]
004015B5 add eax,1
004015B8 test cl,cl
004015BA jne TestApp::TestApp+52h (4015B2h)

Even if you disable intrinsics, you still get the inline strcpy. You have to turn off optimization to get the call to the runtime library strcpy function in a release build. I'm not sure why - strcpy is listed in the list of intrinsic functions the compiler supports but whether or not you get an inline strcpy is affected by the overall optimization setting, not by the /Oi setting which allegedly controls intrinsics.

What I was hoping to see when I started this little test was Whole Program Optimization inlining the call to strcpy whether I had intrinsics enabled or not, but that's not what I'm seeing.

If I create my own custom strcpy function:

void mystrcpy(char *dest, char *src)
{
for (; (*dest = *src) != 0; ++src, ++dest);
}

And I call that, then Whole Program Optimization does kick in and change from a call to the function:

mystrcpy(dest, src);
00401619 lea eax,[esp+18h]
0040161D push eax
0040161E lea ecx,[esp+5Ch]
00401622 push ecx
00401623 call mystrcpy (401910h)
00401628 add esp,14h

Into an inline version of the function:

mystrcpy(dest, src);
00402330 cmp byte ptr [esp],0
00402334 je TestApp::TestApp+6Bh (40234Bh)
00402336 xor eax,eax
00402338 jmp TestApp::TestApp+60h (402340h)
0040233A lea ebx,[ebx]
00402340 mov cl,byte ptr [esp+eax+1]
00402344 add eax,1
00402347 test cl,cl
00402349 jne TestApp::TestApp+60h (402340h)

But I'd take the intrinsic over this version any day. That's what's good about intrinsics - they are functions the compile has special knowledge of, so it can generate customized assembly code that does a better job of implementing that function than what the normal code generation path would generate.

(What got me started on this was a post on the Visual C++ Team Blog about improved intrinsic support in VS2008).

Vista 64: So Far So Good

October 18th, 2007

When I got a new machine at work about a year ago, it came with Vista 64 bit installed on it.  Not long before receiving this machine, I'd tried to upgrade my home machine to Vista 64 and ran into so many problems that I had quite a negative impression of Vista 64.  I didn't trust it for my work machine, so I installed Vista 32 bit.

After using Vista 32 bit on this system for many months, I found that even more quickly than is normal with Windows, I had a system that felt slow.  Launching programs was slow, and there seemed to be a random extra amount of latency whenever I tried to do just about anything.  This is business as usual for Windows:  every now and then you need to rebuild it to recover the speed that you gradually lose as you use it.

(This phenomenon is endemic to Windows, by the way; my Mac Powerbook G4, for example, doesn't seem significantly slower now than when I started using it over two years ago.  I'd love to know what it is that Windows does or allows to happen that sabotages its performance this way, and specifically, why it isn't fixed in Vista).

Anyway, after my quad-core Xeon monster with 4 gig of RAM started taking too long to do basic operations, after only a few months with Vista installed, I knew I had to change something.  It was either go back to XP or try Vista 64, so I went with the latter.

Installing Vista 64 on this new machine was painless.  I don't have a lot of external devices at work, and the ones I do have are mostly supported.  I have a Treo 680 smartphone which isn't supported, but the USB support in VMWare is good enough that I can sync it there, and for everything else, so far Vista 64 is doing just fine.

What prompted me to write this today, though, is the experience of working with Eclipse on Vista 64.  My previous experiences with Eclipse have been pretty bad.  I won't go into details but I'm working on some fairly complex stuff, and every 2nd time I'd launch a debug session, Eclipse would fail and I'd get a JVM error window on the desktop.  Bam.  This happened on two different machines across a couple of different OS installs, so while I'm sure it's something I was doing (and not necessarily Eclipse's or Java's fault), it was in my way.

But the Vista 64 box I'm using now runs this same scenario without breaking a sweat.  It's such a relief being able to hit the Debug button and know it's going to actually bring up a debugger.

The big open question now is, will Vista 64 also slow down over time?  The registry segregation proves that someone was touching that code recently, so there's some hope that something was improved.  Wait and see.