# Monday, January 17, 2005

Florida Code Camp

Just bookmarking this so I don't lose the URL again... Florida Code Camp

 

Monday, January 17, 2005 3:48:09 PM (Eastern Standard Time, UTC-05:00) #  Disclaimer | Comments [0] | 

# Tuesday, January 11, 2005

More garbage collector woes

I couple weeks ago, I recounted some trouble I was experiencing with the .NET garbage collector. My efforts to dispose and clean up objects, and eliminate unnecessary allocations (essentially, to be miserly with resources) brought a great deal of stability, performance, and peace of mind.

However, while much more rare, I still continued to experience random crashes in the application. This time, however, I was able to get Windbg to trap the TerminateProcess, allowing me to perform post-mortem. Here is what I discovered:

In one screen of my application, there is a PictureBox. This screen is displayed while the application is performing lengthy operations, the PictureBox contained an animated GIF. The purpose of this was to keep the user preoccupied while waiting (just like the waving flag at the top right of your browser while pulling down a page). Sounds pretty innocuous.

Well, as it turns out... behind the scenes, either the framework or Windows itself (I did not dig into the PictureBox MSIL to check) actually spins up a thread to pump the frame changes of the animation. Yes, this is a recipe for trouble. A rogue thread running in the system, whose obvious task is to update the GUI (it is pumping the animation). Hard Application crashes are a well-known side-effect of a background thread that does not synchronize all shared (UI) resource access with the owning thread.

So what was happening (confirmed by the smattering of PictureBox and lots of native WinAPI calls over the thread that triggered the crash) is that the animation pump thread was not properly coordinating with the UI thread that actually owned the PictureBox. Or perhaps it was behaving well under normal circumstances, but it was not observing the Garbage Collector's request to pause while the GC does it's thing. You see... the crashes all also happened to occur while the GC was performing a heap walk. While the GC thread is active, all other threads are *supposed* to be paused. But the animation thread was not. And thereby the waking of that animation thread to pump another animation frame, if it happened to wake while the GC was still walking the heap, would cause a very nasty crash.

Simply replacing the graphical content of the PictureBox with a static image (such as a JPG) eliminated the problem by virtue of the offending thread never being created in the first place (it is only created if you have an animated image loaded).

So my primary lesson from this is to simply not use an animated GIF in a PictureBox control. My secondary lesson is that it is still a very wise thing to explicitly clean up after yourself using Dispose() and Clear() on objects that support those semantics, and setting references to null for all non-value types as soon as they are no longer needed. Work *with* the garbage collector, not against it!

 

Tuesday, January 11, 2005 5:30:52 PM (Eastern Standard Time, UTC-05:00) #  Disclaimer | Comments [3] | 

The new Mac Mini

Apple just announced this really slick looking machine... the Mac Mini. I love the form factor, it reminds me of the old SPARC stations we used in college.

I sure would love to see a similar form factor MCE machine, priced around the same ($499). Right now, the best we can do with Media Center is the HP z540/z545 or a “build your own” using something like a D.Vine case from Ahanix.

Tuesday, January 11, 2005 5:06:31 PM (Eastern Standard Time, UTC-05:00) #  Disclaimer | Comments [0] | 

Interested in building your own Media Center Edition machine?

Perhaps, like me, you are contemplating building your own Media Center PC. Perhaps the HP set-top boxes are just too expensive. And the other products from Dell, Viewsonic, etc just look ugly or are too noisy. Well, Microsoft held a live Webcast session a couple days ago, covering the entire build process for putting together an OEM MCE system. Pretty much all you need to know about hardware selection, common issues, and configuration is covered. I tuned in, and found it to be quite informative to someone (like me) who has yet to attempt the building of one. And now, the recorded webcast has been made available for viewing. This link will take you to the registration page if you are interested (60 minute duration webcast).

Tuesday, January 11, 2005 3:10:56 PM (Eastern Standard Time, UTC-05:00) #  Disclaimer | Comments [1] | 

# Thursday, January 06, 2005

Portable Media Center competition

I just saw that there is already a linux-based offering in the PMC space. A company called ARCHOS is releasing the Pocket Media Assistant PMA400 this month (product specification page here). The feature list is very impressive, and it even claims to be capable of dealing with DRM-locked Windows Media files. And for under $800, it's quite an interesting device... especially considering it supports PDA functionality (touch screen!), wifi, wired ethernet, and even can record direct from cable/satellite.

This kind of competition is great, it will help push the envelope in the portable media and media center arenas.

 

Thursday, January 06, 2005 7:39:27 PM (Eastern Standard Time, UTC-05:00) #  Disclaimer | Comments [0] | 
View Keith Rome's profile on LinkedIn

On this page....

Archives

Navigation

Categories

About

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Sign In

Certification Logo Certification Logo Certification Logo Certification Logo Certification Logo

Powered by: newtelligence dasBlog 2.3.9074.18820