So, where was I? Oh yes, last week I was wrestling with hosting providers to get the right version of PHP and playing with WAMP and XAMPP to test PHP-based applications. If my comment about “what was I doing” sounds like I’ve lost track, it’s true, and I’ll come to why in a moment.
So, where was I? Oh yes, last week I was wrestling with hosting providers to get the right version of PHP and playing with WAMP and XAMPP to test PHP-based applications. If my comment about “what was I doing” sounds like I’ve lost track, it’s true, and I’ll come to why in a moment.
Before I explain my distraction I want to mention a comment made by reader Scott Stanton (Seattle), who wrote in to warn that, “Given the number of really useful applications out there that run on PHP 4.x.x, and the fact that some of those applications are not 5.x.x ready, the announcement of the end-of-life of 4.x.x might make some people have to rethink what they are doing.”
Interestingly, XAMPP (which I discussed last week) includes a PHP switch that allows you to change from PHP Version 4 to PHP Version 5 and back again, which makes debugging PHP scripts much easier.
Scott mentioned a useful guide, Migrating from PHP 4 to PHP5, to make the transition easier. He also pointed out a few differences with the new version: “There are some new reserved keywords [about 15] so variables might be in trouble if they overlap, and some functions [maybe 10 or so] changed slightly in how they treat input or respond. The changes will probably have more impact with applications that were haphazardly written [like mine] and don’t follow style recommendations.”
Scott concluded, “All languages get updated as time goes on and they all have incompatibilities with prior versions. … PHP relies on an engine that may change from time to time so older apps may stop working. This is why programmers will always have jobs. PHP6 is in the works.”
So, back to what distracted me last week: Deferred procedure calls, otherwise called DPCs. My problems with DPCs? Too damn many of them.
Let me just make an aside here and explain what DPCs are: According to Wikipedia, deferred procedure calls are “a mechanism which allows the processor which is currently executing a critical task [i.e. the interrupt request level (IRQL) of the processor is high] to perform less critical tasks by deferring their execution to some point later when the processor’s IRQL drops to Dispatch/DPC level or below. It helps the processor to quickly return from a higher IRQL — where all the interrupts below the current IRQL are blocked completely — by performing only those tasks that needed to be performed at that IRQL.”
Normally my various Windows XP machines seem to cruise along with DPCs accounting for a utilization of around 2% of total processor cycles. Last Monday, for no obvious reason, my main desktop’s DPC utilization jumped to around 40%!voilà! There were the DPCs sucking up cycles with wild abandon. And here’s where I started tearing out my hair, because there are no tools I can find to diagnose what is generating DPCs!
I noticed this because the Windows XP GUI slowed to a crawl. The first thing I did was run Process Explorer to see what was going on and,
I suspect that the culprit is a bad driver, because after starting Windows in “safe” mode the processor utilization due to DPCs dropped back to normal. So, how to figure out what’s the problem, because the alternative to finding a fix is rebuilding the machine, which is not something I want to do right now.




