[dmd-concurrency] What about optimistic concurrency control?

Walter Bright walter at digitalmars.com
Sun Jan 10 00:43:53 PST 2010


You might want to read about STM here:

http://www.bluebytesoftware.com/blog/Default.aspx#a4cfad7df-ed84-46a4-a961-54aafdaeb9d7

Essentially, it's a technology with too many fundamental problems.


Tim Matthews wrote:
> So dmd-cc. Whats your opinion on an optimistic concurrency? Heavy 
> exlusive transactions on not allways ideal but an optimistic based 
> approach allows more computation to just keep on running.
>
> This sort of approach which is sometimes called STM (software 
> transactional memory) can crunch a whole lot more numbers if we think 
> "this lock is probably not in use by anyone else, just go for it":
>
> 1) Save a copy/hash of the computations dependencies (arguments to 
> functions that are passed by ref)
> 2) Do the computation.
> 3) If dependencies have changed go to step 1 else commit.
>
> If such algorithms were implemented they should preferably be made 
> implicit with algorithms generic enough for handling any kind of 
> arguments, rolling back etc. If the function doesn't modify any state 
> other than the target result then this could reduce complexity a lot 
> but not necessarily impossible to do with other styles.
>
> I'm not sure if the semantics of D's current pure function 
> implementation could be the base of such algorithms but how much of a 
> speedup is the current D pure optimizations giving us anyway?
>   


More information about the dmd-concurrency mailing list