On 14/07/14 23:26, Jonathan Marler wrote:
Ah I see now. It looks like AST macros are going to open up alot of new
paradigms, I'm excited to see how they progress and what they can do.
It doesn't get us all the way there in this example but its a very good
alternative without having to add
On Sunday, 13 July 2014 at 10:45:29 UTC, Jacob Carlborg wrote:
This would be implemented as a declaration macro [1], something
like this:
macro thread (Context, Ast!(string) name, Declaration decl)
{
if (decl.isVariable)
decl.attributes ~= Thread(name);
else if
On 2014-07-11 19:07, Jonathan Marler wrote:
I'm not sure how AST macros would assist in thread safety the way that
this feature would. Maybe you could elaborate?
Looking at the first example:
@thread:main
int mainThreadGlobal;
@thread:main
int main(string[] args)
{
// Start the worker
On Friday, 11 July 2014 at 18:56:07 UTC, Timon Gehr wrote:
On 07/10/2014 08:12 PM, Jonathan Marler wrote:
So what do people think?
How do you make sure there is at most one thread of each kind?
Good question. First, since the language doesn't support starting
threads itself (like Go) but
On 10/07/14 20:12, Jonathan Marler wrote:
I had an idea this morning and wanted to post it to see what people think.
I know we have alot of attributes already but I'm wondering if people
think adding a thread attribute could be useful. Something that says a
variable or function or class/struct
I'm not sure how AST macros would assist in thread safety the way
that this feature would. Maybe you could elaborate?
To explain a little more, when you put a @thread:name or
@sync(object) attribute on something, the compiler will guarantee
that no safe D code will ever use that code or data
On 07/10/2014 08:12 PM, Jonathan Marler wrote:
So what do people think?
How do you make sure there is at most one thread of each kind?
I had an idea this morning and wanted to post it to see what
people think.
I know we have alot of attributes already but I'm wondering if
people think adding a thread attribute could be useful.
Something that says a variable or function or class/struct can
only be accessed by code that has