On Monday, 14 September 2015 at 08:08:35 UTC, Ali Çehreli wrote:
void main()
{
MultiThreadedUnique!S u1 = produce();
auto childTid2 = spawn(, thisTid);
u1.giveTo(childTid2);
send(childTid2, cast(shared(MultiThreadedUnique!S*)));
import core.thread;
thread_joinAll();
On Monday, 14 September 2015 at 00:11:07 UTC, Ali Çehreli wrote:
On 09/13/2015 09:09 AM, Alex wrote:
> I'm new to this forum so, please excuse me in advance for
> asking silly questions.
Before somebody else says it: There are no silly questions. :)
> struct std.typecons.Unique!(S).Unique is
On Monday, 14 September 2015 at 00:11:07 UTC, Ali Çehreli wrote:
There is a misconception. Unique guarantees that the object
will not be copied. It does not provide any guarantee that only
one thread will access the object. It is possible to write a
type that acquires a lock during certain
On 09/14/2015 12:07 AM, Alex wrote:
> Do you have a hint how to create such a type? The needed operation is
> "onPassingTo" another thread. So the idea is to create a resource, which
> is not really shared (a question of definition, I think), as it should
> be accessible only from one thread at
On Monday, 14 September 2015 at 00:11:07 UTC, Ali Çehreli wrote:
send(childTid2, cast(shared(Unique!S*)));
And yeah this violates the idea of Unique. Sadly, I am not aware
of any way to prohibit taking address of an aggregate.
Hi everybody! I'm new to this forum so, please excuse me in
advance for asking silly questions. I think I'm not the first
person which wondering about this topic, but I'm trying to
combine Unique type and concurrency module, getting the compiler
error
struct std.typecons.Unique!(S).Unique is
On 09/13/2015 09:09 AM, Alex wrote:
> I'm new to this forum so, please excuse me in advance for
> asking silly questions.
Before somebody else says it: There are no silly questions. :)
> struct std.typecons.Unique!(S).Unique is not copyable because it is
> annotated with @disable
I have made