Exception caused by calling a pure function repeatedly
Ali Çehreli
acehreli at yahoo.com
Wed May 30 08:24:55 PDT 2012
On 05/30/2012 06:49 AM, ixid wrote:
> What happens to ref const in a multi-threaded
> environment? Is it locked by the const ref function until it has
> finished or can other threads modify it?
Yes, other threads can modify it but it would have to be marked as
'shared' to begin with. Otherwise only one thread could access it.
Then, it is still your responsibility to lock the data; but the best
approach is to use message passing concurrency. I have a chapter on that:
http://ddili.org/ders/d.en/concurrency.html
Ali
More information about the Digitalmars-d-learn
mailing list