Concurrent programming

  • I've mentioned this topic a few times in recent weeks, so it was really time to sit down and put pen to paper (or fingers to keyboard). This one was a lot of fun to dig into, and I think the results will be of interest to people. Parallelism is something that I've been tracking since my studies during the 90s: I remember programming transputers using a programming language called occam, way back when. I was really happy when – around a decade ago – Microsoft got serious about tackling asynchrony and concurrency with F#'s Asynchronous Workflows and the .NET…

  • Despite the fact we can't currently use it inside AutoCAD – we're still using .NET 4.0 in AutoCAD 2014 – of late I've been working more with the async/await capability in .NET 4.5, which has been really interesting. I've worked with asynchronous operations in .NET languages on and off for some time, having started with F#'s Asynchronous Workflows and then spent some time with C#'s async/await after hearing Stephen Toub speak at Microsoft Switzerland a couple of years ago. It feels like it's been a while since I did much of that, though: I used the Async CTP sporadically with Visual…

  • I've been looking for an interesting problem to solve using MapReduce for some time now. I've been curious about the paradigm and how it can be applied to churn through large sets of data across multiple processing cores: something that's especially relevant as we need to distribute processing – whether to cores that are local or up in the cloud – in order to improve software performance. I talked about much of this when I looked at F#'s Asynchronous Workflows way back when (nearly 6 years ago – ouch). MapReduce frameworks – and there are a number out there: in…

  • As promised, I'm going to spend some time this week looking at options for moving the Python code we've seen in this series of posts – that de-skews perspective images using CPython or IronPython code running on your desktop – to "the cloud". Which in this case I'm taking to mean Google App Engine (GAE), as it has native Python support and I hadn't done anything with it, before. 🙂 As a first step – and I should probably say "at first glance" – it's really quite easy to take some existing Python code and host it behind a web-service…

  • As promised in my last post, I spent some time hacking together a basic application to get a feel for what it's like to develop inside the WinRT sandbox for Windows 8. If you're interested in the source code, here it is. Be warned: the code is really just to prove a concept – there's a lot therein I'd consider sub-optimal for a production application. If you're more interested in seeing the application in action, but haven't yet installed the Windows 8 Consumer Preview, then here's a quick screencast I recorded: A few comments on the experience of developing with…

  • In the first of this week's posts on the new, developer-oriented features in AutoCAD 2013, we're going to take a look at the AutoCAD Core Console. I predict that this one feature alone is going to be worth its weight in gold to many customers and developers. Picture this: a stripped down version of AutoCAD – but only from a UI perspective – that can be executed from a standard Command Prompt. We're talking about a version with almost all the capabilities of full AutoCAD – with the ability to load certain applications and execute scripts – but launches in…

  • This post continues the series on fill algorithms for 3D printing by looking specifically at an Apollonian sphere packing. In the last post we got most of the way there, but today we're going to introduce a more elegant algorithm for solving the problem (with pretty impressive results :-). Many thanks to Professor Ronald Peikert from ETH Zurich for kindly providing the C++ code used to generate the F# code in today's post. The original algorithm was outlined in this paper co-authored by Professor Peikert, under the section The "Inversion Algorithm" and – as you might divine from the name…

  • I've been planning to look at it for ages – and have certainly mentioned it before – but other things have kept on cropping up. Well last Thursday, on my train trip back from Wallisellen (the home of Microsoft Switzerland), I finally managed to take the plunge and start working with the Async CTP for Visual Studio 2010. I'd been in Wallisellen to attend an MSDN TechTalk presentation by Stephen Toub, Principal Architect on Microsoft's Parallel Computing Platform team. I've followed Stephen via his blog – and the Parallel Programming with .NET blog – for a long time, and thought…

  • Or perhaps the title should really be "why it's really a good idea to avoid misusing mutable state when using F# Asynchronous Workflows". Ultimately I wanted to share a brief (or not, we'll see), cautionary tale about the dangers of shared state when implementing concurrent tasks. I've been using F# for some time, and have it fairly well drilled into my skull by this point that shared, mutable state is bad. And yet occasionally it somehow creeps in as an expedient way to solve certain issues: perhaps it's just a lack of discipline on my part or the years of…

  • In the previous posts in this series we introduced a command that downloaded and imported point clouds from Photosynth.net, we introduced a WinForms user interface on top of it and then replaced that UI with one implemented using WPF. As threatened last time, we're now going to make some efficiency improvements in the original command implementation. In our previous implementation we were blindly asking for files, one after the other, and using failure to indicate when we'd reached the end. Which was fine, but it limited us in a few ways: we could not reliably parallelize this otherwise highly parallelizable…