Re: Modify thread-local storage from parent thread

2011-08-09 Thread Ali Çehreli
On Tue, 09 Aug 2011 20:37:04 +, Ali Çehreli wrote: >> I wonder if I could: >> Create a thread (task) >> Read bytes directly into the tasks' thread local storage Execute the >> thread > > I don't know what copies happen behind the scenes in the following code, > but std.paralleism is great whe

Re: Modify thread-local storage from parent thread

2011-08-09 Thread Ali Çehreli
On Mon, 08 Aug 2011 12:17:28 -0600, Kai Meyer wrote: > I am playing with threading, and I am doing something like this: > file.rawRead(bytes); > auto tmpTask = task!do_something(bytes.idup); > task_pool.put(tmpTask); > Is there a way to avoid the idup (or can somebody ex

Re: Modify thread-local storage from parent thread

2011-08-09 Thread Steven Schveighoffer
On Tue, 09 Aug 2011 12:59:46 -0400, Kai Meyer wrote: On 08/09/2011 10:27 AM, Steven Schveighoffer wrote: On Tue, 09 Aug 2011 11:36:13 -0400, Kai Meyer wrote: On 08/08/2011 01:38 PM, Steven Schveighoffer wrote: On Mon, 08 Aug 2011 14:17:28 -0400, Kai Meyer wrote: I am playing with thre

Re: Modify thread-local storage from parent thread

2011-08-09 Thread Kai Meyer
On 08/09/2011 10:27 AM, Steven Schveighoffer wrote: On Tue, 09 Aug 2011 11:36:13 -0400, Kai Meyer wrote: On 08/08/2011 01:38 PM, Steven Schveighoffer wrote: On Mon, 08 Aug 2011 14:17:28 -0400, Kai Meyer wrote: I am playing with threading, and I am doing something like this: file.rawRead(by

Re: Modify thread-local storage from parent thread

2011-08-09 Thread Steven Schveighoffer
On Tue, 09 Aug 2011 11:36:13 -0400, Kai Meyer wrote: On 08/08/2011 01:38 PM, Steven Schveighoffer wrote: On Mon, 08 Aug 2011 14:17:28 -0400, Kai Meyer wrote: I am playing with threading, and I am doing something like this: file.rawRead(bytes); auto tmpTask = task!do_something(bytes.idup); t

Re: Modify thread-local storage from parent thread

2011-08-09 Thread Kai Meyer
On 08/08/2011 01:38 PM, Steven Schveighoffer wrote: On Mon, 08 Aug 2011 14:17:28 -0400, Kai Meyer wrote: I am playing with threading, and I am doing something like this: file.rawRead(bytes); auto tmpTask = task!do_something(bytes.idup); task_pool.put(tmpTask); Is there a way to avoid the idup

Re: Modify thread-local storage from parent thread

2011-08-08 Thread Steven Schveighoffer
On Mon, 08 Aug 2011 14:17:28 -0400, Kai Meyer wrote: I am playing with threading, and I am doing something like this: file.rawRead(bytes); auto tmpTask = task!do_something(bytes.idup); task_pool.put(tmpTask); Is there a way to avoid the idup (or can somebody explain w

Modify thread-local storage from parent thread

2011-08-08 Thread Kai Meyer
I am playing with threading, and I am doing something like this: file.rawRead(bytes); auto tmpTask = task!do_something(bytes.idup); task_pool.put(tmpTask); Is there a way to avoid the idup (or can somebody explain why idup here is not expensive?) If the logic above is ex