Posts

Showing posts with the label concurrency

Get in the Queue, your locks don't work here

Threading, locking and concurrency are all hot topics at the moment. One place where threading and locking don't work as a way of controlling access to shared resources are in distributed web applications. This blog entry by Tarn Barford discusses the use of Queues from IronPython (with plenty of example code) when working with web apps on the Azure platform. Get in the Queue, your locks don't work here I am, of course, talking about a pattern in high scale web application design, Queues. More specifically the Queue service on the Windows Azure cloud computing platform. So when do you use Queues? Its common to use thread synchronization objects in a web application to serialize access to a resource, but this thread synchronization approach doesn't work so well when you have multiple applications, over multiple servers competing for exclusive access to a global resource. The first scenario I've found which suits the Queue service is in a user driven content ranking syste...

IronPython + F# + Parallel + Async = A Kittehz Brekfst

Image
Concurrency with threading can be a tricky subject, particularly amongst the Python community . Nick Hodge has a blog entry on using the .NET Parallel Extensions to write concurrent libraries in F#, and then using them from IronPython: IronPython + F# + Parallel + Async = A Kittehz Brekfst Whilst thread-safety, dead-locks, queues and other nasties are nasty, Microsoft sees the world of n-cores as a software problem to be solved, not ignored. Both at a low-level and a high-level, well constructed and debugged Parallel libraries are appearing to make the splitting of tasks easier. IronPython implements the Python language on the DLR and subsequently on the CLR, but this does not automagically provide IronPython with threading and parallelism. Nor could I suggest that IronPython is the silver-bullet for clean parallelism with Python. Various projects such as ParallelPython (including cluster support), Stackless Python and the recent python-multiprocessing package are appearing to move CP...