Before we start let's break this down into a few sections: Why did the problem occur? Solution that I implemented Thread-safety? I've tried my best to make it as generic and language independent as possible but I've added some Java code since I wor...

Markdown supported · ⌘↵ to post
Note that "speed-up" of the API comes with the price of the result obtaining. In you case you just get rid of blocking call delegating it to other thread (fire-and-forget). If the result is needed you will need a polling system with storing async id or similar.
Spring's async support made for more general idea, it is about to bring full scale async support to platform hiding the complexity of the Future facility. Async idea is about to minimise thread blocking and more fare resource managing (task spliting, job stealing). Also Spring take care of thread locals propagations (for example, security context).
Also locks. Locks are much more preferable than syncronize blocks/methods as they are using CaS instructions.