The Old New Thing

Controlling resource consumption by meting out work items

At the PDC, one person came to talk to me for advice on a resource management problem they were having. To simplify, their system generated dozens of work items, each of which required significant resource consumption. For the sake of illustration, let's say that each of the work items was a single-threaded computationally-intensive operation ...

A thread waiting on a synchronization object could be caught napping

If you have a synchronization object, say a semaphore, and two threads waiting on the semaphore, and you then release two semaphore tokens with a single call to , you would expect that each of the waiting threads would be woken, each obtaining one token. And in fact, that's what happens—most of the time. Recall in our discussion of why...

Why does the size of a combo box include the size of the drop-down?

Many people are surprised to discover that when you create a combo box (either in code via or indirectly via a dialog box template), the size you specify describes the size of the combo box including the drop-down list box, even though the drop-down list box is not visible on the screen. For example, if you say that you want the combo box to ...

If you ask for a window caption, you also get a border

Some people may have noticed that the is defined as the combination of and : Since includes , it is impossible to get a caption without a border. Sometimes people don't quite get this and keep asking the question over and over again, and I have to keep trying to explain the laws of logic in different ways until one of them finally ...

Why is there no message for disabling the Cancel button on a wizard?

Some people have noticed that there is no message that lets you disable the Cancel button on a wizard. This is on purpose. Usability studies reveal that users find it extremely frustrating when they get partway through a wizard and then decide they don't want to perform the operation after all, but find that the wizard doesn't give them a way ...

Raymond, you even pose like a girl

Okay, so it's bad enough that I write like a girl. (And so does Betsy.) Now, Korby Parnell reported on a little get-together of some Microsoft bloggers, and in the photograph you can see that I'm doing the "peace" sign, just like young Japanese women do in photographs. Apparently, boys are supposed to strike a superhero pose, but the peace...