CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Karl Seguin

.NET From Ottawa, Ontario - http://twitter.com/karlseguin/

September 2007 - Posts

  • Better multithreading support needed in .NET

    This is the kind of post you make, and immediately get 4 comments saying the class you requested is already in the framework....

    I've been working a lot on multithreaded applications lately. I'm not specifically talking about taking advantage of multi-core CPUs on the client, but it's been clear for a while now that these are quickly becoming the norm and developers are going to have to adapt.

    I've mostly been learning as I go, but it's made me realize that the tools available to developers are lacking. To be honest, I don't want to have to understand what the heck Greg Young is blogging about - he speaks a different language than me - I want tools and my programming language to help me out as much as possible. PLinq is interesting, but it's a minor part of the overall picture.

    Java seems ahead of .NET when it comes to multithreading programming.  They have true thread-safe collections that use lock-free algorithms. If you're doing multithreading programming, do yourself a favor and look up Lock Free Data Structures, you'll quickly realize that most of what you've read on MSDN as well as Microsoft own thread-safe collections are garbage. I've used Julian Bucknall's collections with quite a bit of success. It'd also be nice to have truly atomic variables in .NET, like those found in Java's java.util.concurrent.atomic package - there's something unsettling about playing with the Interlock class.

    Like Chris Mullins, I wish there was an exposed ThreadPool class. I don't know if he ever solved his problem of thread starvation, but we've also had to write our own implementation because we couldn't guarantee all of our operations would be asynch. Coincidentally, if you're creating a  socket server, there are numerous blog posts on the Conversant blog worth reading.

    At the top of my wish list though is support for multithreading testing. Multithreaded applications might be hard to write, but they are a nightmare to test. It's easy enough to run multiple threads over your code, but I haven't yet seen (which doesn't mean it doesn't exist), something that lets you transparently test specific race and deadlock conditions. Was a waiting thread properly signaled? Was a deadlock properly resolved? So far my approach has been simply to put huge loads on the application and hope problems surface.
     

    Posted Sep 10 2007, 09:16 AM by karl with 18 comment(s)
    Filed under:
  • How Microsoft tried to screw me out of $30.00

    I have the lofty goal of becoming more financially responsible. Since I'm a Microsoft fanboy, I figure I'll buy Microsoft Money 2008. I head over to the website and see that Plus Premium is $49.99USD - same as the equivalent Quickens. I click on the "download now" which adds Money 2008 to my shopping card for $79.99. WTF?

    It turns out $49.99 is only the manufacturer's suggested retail price - which I guess Microsoft expects everyone to follow except themselves.

    So I bought Quickens.


    UPDATE
    Turns out there's a $30 mail-in-rebate, but from the page I was on, it isn't at all clear:
    http://www.microsoft.com/money/ProductDetails.aspx?pid=004&active_tab=Compare
     

  • NHibernate in Action

    I've been busy like a bee (for anyone curious, even though I know nothing about bees, I've somehow convinced myself that my fall-back job would be to run an apiary), but I've managed to squeeze in a couple chapters of NHibernate in Action. The book was supposed to be out in August, so i expect it'll be out any day now. The authors also happen to have stellar credentials Smile

    I'm far along enough to say that the book is a good read and a great introduction to NHibernate - which is complex enough to merit a couple books. The early chapters, which deal mostly with high level stuff and configuration are by no means mind-blowing entertaining, but getting through them wasn't a chore. Probably because they cover the basic configuration upfront and refer to the reference manual for everything else. I'm not too deep into the rest of it, but so far so good, and skipping ahead at the later chapters I'm glad to see many advanced topics seem to be covered.

    If you can't wait, you can get access to an early version ebook for $25.00 via http://www.manning.com/kuate/. Personally, I think $25.00 is overpriced for ANY ebook - but I bought it nonetheless because there really isn't any other alternative.

    This is a good compliment to NHibernate's excellent reference manual. Also worth mentioning is that Jimmy Nilsson's Applying Domain-Driven Design and Patterns: With Examples in C# and .NET has a chapter devoted to NHibernate.

     

More Posts

Our Sponsors

Proudly Partnered With