Re: D const enables multi-reader synchronization

2010-06-17 Thread Sean Kelly
Tomek Sowiński j...@ask.me wrote: Sean Kelly wrote: Tomek Sowi�ski Wrote: This is a continuation of a recent thread Synchronized const methods on D.learn. Currently only one thread at a time can execute a synchronized method. But think about D's const -- it's deep, so if a method

Re: D const enables multi-reader synchronization

2010-06-16 Thread Robert Jacques
On Tue, 15 Jun 2010 14:47:08 -0400, Jérôme M. Berger jeber...@free.fr wrote: Robert Jacques wrote: On Mon, 14 Jun 2010 15:17:57 -0400, Tomek Sowiński j...@ask.me wrote: This is a continuation of a recent thread Synchronized const methods on D.learn. Currently only one thread at a time can

Re: D const enables multi-reader synchronization

2010-06-15 Thread Jérôme M. Berger
Robert Jacques wrote: On Mon, 14 Jun 2010 15:17:57 -0400, Tomek Sowiński j...@ask.me wrote: This is a continuation of a recent thread Synchronized const methods on D.learn. Currently only one thread at a time can execute a synchronized method. But think about D's const -- it's deep, so if a

Re: D const enables multi-reader synchronization

2010-06-15 Thread Tomek Sowiński
Brad Roberts wrote: On Mon, 14 Jun 2010, Tomek Sowi?ski wrote: Dnia 14-06-2010 o 21:27:24 Brad Roberts bra...@slice-2.puremagic.com napisa?(a): Const methods only prevent mutating 'this'. You can still call functions that mutate other state (via globals or passed in arguments). But

Re: D const enables multi-reader synchronization

2010-06-15 Thread Tomek Sowiński
Sean Kelly wrote: Tomek Sowi�ski Wrote: This is a continuation of a recent thread Synchronized const methods on D.learn. Currently only one thread at a time can execute a synchronized method. But think about D's const -- it's deep, so if a method is const, it can't possibly mutate its

D const enables multi-reader synchronization

2010-06-14 Thread Tomek Sowiński
This is a continuation of a recent thread Synchronized const methods on D.learn. Currently only one thread at a time can execute a synchronized method. But think about D's const -- it's deep, so if a method is const, it can't possibly mutate its object. So many synchronized const method

Re: D const enables multi-reader synchronization

2010-06-14 Thread Brad Roberts
On Mon, 14 Jun 2010, Tomek Sowi?ski wrote: This is a continuation of a recent thread Synchronized const methods on D.learn. Currently only one thread at a time can execute a synchronized method. But think about D's const -- it's deep, so if a method is const, it can't possibly mutate its

Re: D const enables multi-reader synchronization

2010-06-14 Thread Tomek Sowiński
Dnia 14-06-2010 o 21:27:24 Brad Roberts bra...@slice-2.puremagic.com napisał(a): On Mon, 14 Jun 2010, Tomek Sowi?ski wrote: This is a continuation of a recent thread Synchronized const methods on D.learn. Currently only one thread at a time can execute a synchronized method. But think

Re: D const enables multi-reader synchronization

2010-06-14 Thread Jérôme M. Berger
Tomek Sowiński wrote: 3. If answer to 2. is yes, how do we tackle write-starvation? In a read-mostly scenario the mutating thread may be held up forever. I'd say that as soon as someone requests the write lock, nobody can get the read lock anymore. Then when the current readers release

Re: D const enables multi-reader synchronization

2010-06-14 Thread Robert Jacques
On Mon, 14 Jun 2010 15:17:57 -0400, Tomek Sowiński j...@ask.me wrote: This is a continuation of a recent thread Synchronized const methods on D.learn. Currently only one thread at a time can execute a synchronized method. But think about D's const -- it's deep, so if a method is const, it

Re: D const enables multi-reader synchronization

2010-06-14 Thread Sean Kelly
Tomek Sowiñski Wrote: This is a continuation of a recent thread Synchronized const methods on D.learn. Currently only one thread at a time can execute a synchronized method. But think about D's const -- it's deep, so if a method is const, it can't possibly mutate its object. So many