On Aug 27, 2011, at 10:14 AM, Benjamin Thaut wrote:

> After having used the D 2.0 programming language for a year now and having 
> completed 3 projects with it, I wrote a small article about the problems I 
> had with the D 2.0 programming language and what suggestions I have to 
> improve it.

Here's another one:

"8. std.concurreny TID does not support shared"

I really need to fix this.  It's a pain though, for the reasons related to the 
ones you mention in "5. Shared".  A tid, for example, fronts a message queue 
object that has some shared interface elements and some unshared interface 
elements.  The shared portion, rather than labeling functions as synchronized, 
uses synchronized internally to make the mutex use as fine-grained as possible. 
 And the logically unshared portion only synchronizes when accessing the shared 
data in the object.  So to make Tid work with shared I would basically have to 
label the shared methods as shared and re-evaluate the ASM output once the 
compiler inserts memory barriers, and cast away shared when accessing the 
message queue from within its owner thread.  What gets me about all this is 
that rather than helping me, the type system is working against me.  I love 
shared as far as its use for globals is concerned, and for concrete variables, 
but not so much for classes.

Reply via email to