On 2011-11-11 02:48:52 +0400, Timon Gehr said:
On 11/10/2011 11:00 PM, Ruslan Mullakhmetov wrote:
On 2011-11-11 01:23:01 +0400, Timon Gehr said:
class Foo
{
}
void worker( shared(Foo[]) data_ )
{
Foo[] data = cast() data_; // this cast is valid because data_ is
never read from another threa
Timon Gehr:
> Interesting, apparently cast() does not remove shared.
The semantics of cast() was never formalized, I think. People use this idiom,
so I think we have to formalize what cast() exactly does. This is meat for
Bugzilla or even for discussion topic in the main D newsgroup.
Generally
On 11/10/2011 11:23 PM, Ali Çehreli wrote:
On 11/10/2011 01:57 PM, Ruslan Mullakhmetov wrote:
On 2011-11-11 01:21:09 +0400, Ali Çehreli said:
class Foo
{
}
void worker( shared(Foo)[] data )
{
//...
}
void main()
{
auto data = new shared(Foo)[10];
spawn( &worker, data );
}
Thanks. I tried
On 11/10/2011 11:00 PM, Ruslan Mullakhmetov wrote:
On 2011-11-11 01:23:01 +0400, Timon Gehr said:
class Foo
{
}
void worker( shared(Foo[]) data_ )
{
Foo[] data = cast() data_; // this cast is valid because data_ is
never read from another thread after the cast
//...
}
void main()
{
{
auto da
On 11/10/2011 01:57 PM, Ruslan Mullakhmetov wrote:
On 2011-11-11 01:21:09 +0400, Ali Çehreli said:
class Foo
{
}
void worker( shared(Foo)[] data )
{
//...
}
void main()
{
auto data = new shared(Foo)[10];
spawn( &worker, data );
}
Thanks. I tried to use the second version, a lttle bit modi
On 2011-11-11 01:23:01 +0400, Timon Gehr said:
class Foo
{
}
void worker( shared(Foo[]) data_ )
{
Foo[] data = cast() data_; // this cast is valid because data_ is
never read from another thread after the cast
//...
}
void main()
{
{
auto data = new Foo[10];
On 2011-11-11 01:21:09 +0400, Ali Çehreli said:
class Foo
{
}
void worker( shared(Foo)[] data )
{
//...
}
void main()
{
auto data = new shared(Foo)[10];
spawn( &worker, data );
}
Thanks. I tried to use the second version, a lttle bit modified it for
actual mutation and it i
On 11/10/2011 10:06 PM, Ruslan Mullakhmetov wrote:
Hi folks,
I need to create thread and pass to it array of objects wich will no
longer use in main thread.
The problem is that spawn only accepts immutables and i have no idea how
to tell him that i transfer full ownership of the data to child t
On 11/10/2011 01:06 PM, Ruslan Mullakhmetov wrote:
Hi folks,
I need to create thread and pass to it array of objects wich will no
longer use in main thread.
The problem is that spawn only accepts immutables and i have no idea how
to tell him that i transfer full ownership of the data to child t
Hi folks,
I need to create thread and pass to it array of objects wich will no
longer use in main thread.
The problem is that spawn only accepts immutables and i have no idea
how to tell him that i transfer full ownership of the data to child
thread.
the code:
import std.concurrency
10 matches
Mail list logo