A few thoughts on std.allocator

via Digitalmars-d digitalmars-d at puremagic.com
Mon May 11 04:42:21 PDT 2015


On Monday, 11 May 2015 at 10:54:10 UTC, Jonathan M Davis wrote:
> doing the allocation, but I don't see how we can get rid of the 
> possibility of an object being allocated on one thread and 
> deallocated on another without making major changes to shared - 
> and std.concurrency isn't going to work very well if we can't 
> cast to and from shared or immutable to pass objects across 
> threads - not unless we add some way to indicate in the type 
> system that a variable is being passed across threads.

Behavioural typing is an active research field so if you are to 
statically prove that a specific program configuration at runtime 
causes a type to be unshared/immutable you are outside the 
language design comfort zone. Which I am very much in favour of 
;-).

More on behavioural typing:

http://forum.dlang.org/thread/ovoarcbexpvrrceysnrs@forum.dlang.org

Of course, the sensible thing to do is to have "behavioural 
typing light". E.g. to allow passage through gateways (with 
rather limiting constraints which allows static verification).


More information about the Digitalmars-d mailing list