Passing data and ownership to new thread
James Brister via Digitalmars-d Tue, 26 Sep 2017 02:15:45 -0700
I'm pretty new to D, but from what I've seen there are two modes
of using data across threads: (a) immutable message passing and
the new thread copies the data if it needs to be modified, (b)
shared, assuming the data will be modified by both threads, and
the limits that imposes . But why nothing for passing an object
of some sort to another thread with the ownership moving to the
new thread. I suppose this would be hard enforce at the language
level, but wouldn't you want this when trying to pass large-ish
data structures from one thread to another (thinking of a network
server, such as a DHCP server, that has a thread for handling the
network interface and it reads the incoming requests and then
passes off to another thread to handle).
- Passing data and ownership to new threa... James Brister via Digitalmars-d
- Re: Passing data and ownership to ... Jonathan M Davis via Digitalmars-d
- Re: Passing data and ownership to ... Moritz Maxeiner via Digitalmars-d
- Re: Passing data and ownership to ... Moritz Maxeiner via Digitalmars-d
- Re: Passing data and ownership to ... jmh530 via Digitalmars-d
