www.dajudge.com

JudgeBlog

3/7/2010

Concurrent execution of a dependency graph of threads

During the development phase of my diploma thesis I faced the probl^em of having a bunch of potentially concurrent operations where some dependencies had to be obeyed to finally evaluate to a valid XQuery. Basically this boils down to having a dependency graph and starting threads as they become ready (where the initial point of execution are jobs that don't have dependencies). Two minutes of (not so thorough) Google™ research made me wonder how I could be the only one on the planet to face this problem and soon I felt the itch to implement a suitable library...

The result is a small job scheduling library that takes a number of jobs, lets you define dependencies amongst them and executes them in concurrent threads where possible. The general concept is to start threads that don't have unresolved dependencies and check readiness every time a dependency finishes execution. That way you get dependency management for concurrent job execution without polling. The tricky part was to get it working without deadlocks.

Some interesting facts about the library:

  • Easy to drop in: no dependencies
  • Full control over thread management - culminates in fully serialized dependency execution if you don't create threads at all
  • Supposed to be deadlock free by avoiding locking of more than one resource at once (Thanks applied CS 1)
  • Licensed under the EPL :-)
  • Source code available (check out the project page)

Happy coding!



About Me

Myself Hi, my name is Alexander Stockinger and this is my personal website. I am building software at crealytics GmbH in Passau, Germany and have a passion for the latest technologies and trends.

Blog Index

Just finished my schedule for Berlin Buzzwords :-) posted on 6/5/2010
I'm going to BerlinBuzzwords! posted on 5/21/2010
Installing CouchDB 0.11 on Debian Squeeze posted on 4/2/2010
CouchDB 0.11.0 released with these new features posted on 3/30/2010
CouchDB 0.11 around the corner posted on 3/23/2010
GEZ will Gebühren für Kassen im Steakhouse posted on 3/18/2010

rss iconSubscribe to RSS Feed

twitter icon Latest Tweets

alexstockinger: RT @cnet #Android market share to surge over next four years | Wireless - CNET News http://bit.ly/bzIo8d 7:41am 09/09/10 via mobile web

alexstockinger: Never leave your computar unlocked when you have funny co-workers around... 4:42pm 09/08/10 via Echofon

alexstockinger: @ikai They're obviously copying Apple's strategy with Windows Phone 7 here: Less features - more marketing... Ingenious! :-) 9:23am 09/07/10 via HTC Peep

alexstockinger: RT @Xconomy The Leaning Tower of #Ping: How iTunes Could Be #Apple?s #Undoing http://xconomy.com/?p=100966 10:58pm 09/03/10 via mobile web

more...

Cool Sites

gamedev.net Anderscht SoundScientists JECC
qrcode