Deadlock detection – finally released

I’d hoped to be able to make this post a week ago, but adding extra unit tests, performance tests and documentation took longer than expected. (Doesn’t it always?) I’ve now refactored the previous incarnation of SyncLock in my Miscellaneous Utility Library (snappy title, huh?) and added a new type of lock which can detect deadlocks (throwing an exception instead of entering the deadlock-prone state). There’s also a usage page explaining how to use the locks, and what the performance impact is. (Well, what it is on my box, anyway.) Any further suggestions now it’s concrete are welcome, of course.

Pedantry – how much is too much?

I’m a pedant, there’s no doubt about it. I’m particularly pedantic when it comes to terminology in computing discussions – at least where I see value in being precise about what is meant. So, when discussing static constructors in a mailing list thread recently, I’ve been very carefully distinguishing between a static constructor (which is a C# term) and a type initializer (which is a CLI term). This hasn’t been met terribly favourably by those who wish to use the term “static constructor” to mean both the .cctor member in a (compiled) type and the C# static constructor, despite them … Continue reading Pedantry – how much is too much?

What kind of deadlock prevention do you want?

Okay, so I’m having another look at the alternative threading ideas which are part of my threading article. (They’re not that big an alternative really – not compared with CSP etc – they’d just make things more pleasant.) I want to add deadlock prevention to my locks, making it impossible to lock things incorrectly (so long as you’re locking the simple way – if you lock the associated monitor independently, that’s your own lookout). Obviously this requires you to set up what’s correct and what’s incorrect to start with. My question to you all is: how do you want to … Continue reading What kind of deadlock prevention do you want?

Visual Studio vs Eclipse

I often see people in newsgroups saying how wonderful Visual Studio is, and they often claim it’s the “best IDE in the world”. Strangely enough, most go silent when I ask how many other IDEs they’ve used for a significant amount of time. I’m not going to make any claims as to which IDE is “the best” – I haven’t used all the IDEs available, and I know full well that one (IDEA) is often regarded as superior to Eclipse. However, here are a few reasons I prefer Eclipse to Visual Studio (even bearing in mind VS 2005, which is … Continue reading Visual Studio vs Eclipse

RSS for my articles

A friend suggested on Sunday that I create an RSS feed for my articles, so that interested parties would know when I’ve created a new one – so I’ve done it. It’s hand-crafted, so there may be a few wrinkles to iron out, but hopefully it will prove useful. It would be nice if there was a way of specifying the last time that an item had been updated (rather than the original publishing date). I can’t see anything like that in the spec but maybe I’ve missed something. The feed works in Thunderbird at least – let me know … Continue reading RSS for my articles

New (to me) threading paradigms

In the last couple of days, I’ve been reading up on CSPs (Communicating Sequential Processes) and the Microsoft Research project CCR (Concurrency and Coordination Runtime). I suspect that the latter is really a new look at the former, but I don’t have enough experience with either of them to tell. Now, I know a number of my readers are smart folks who have probably lived and breathed these things for a while – so, is my hunch right, or are they fundamentally different models? A few links for further reading: CCR Channel 9 video Channel 9 wiki OOPSLA/SCOOL paper CSP … Continue reading New (to me) threading paradigms

System.Random (and java.util.Random)

This is as much a “before you forget about it” post as anything else. Both Java and .NET have Random classes, which allow you to get random numbers within a certain range etc. Unless you specify otherwise, both are seeded with the current time. Neither class claims to be thread-safe. This presents a problem – typically you effectively just want one source of random numbers, but you want to be able to access it from multiple threads. You certainly don’t want to create a new instance of the Random class every time you want a random number – due to … Continue reading System.Random (and java.util.Random)

Adverts on my C# article pages?

I had an email today which suggested I should start advertising on my C# article pages. I’ve considered this in the past without coming to any conclusions. I would certainly plump for Google AdSense on the grounds that it’s fairly non-invasive. I just can’t decide whether or not it’s a good idea. Pros: I get money for things which do actually take a fair amount of time to write. Cons: I’d need to work out what the tax implications are (particularly in terms of being in the UK when Google is in the US). I don’t currently fill in a … Continue reading Adverts on my C# article pages?