On Tuesday, 22 April 2014 at 14:07:47 UTC, Steven Schveighoffer wrote:
know this you are required to know the internals of the framework you are utilizing or inject runtime guards into your D functions?

Or just mark those objects sent into the framework as shared. Having multi-threaded RC isn't bad, just not as efficient.

Actually, when I think of it, guards probably would be cheap. All you have to do is to store the thread-context-pointer-register into a global when the thread starts up. Then just do a simple if-test at the function invocation. (assuming the register doesn't change over time).

Actually, it could be done as a self-modifying pass at startup… That would make it a register test against an immediate value, no memory buss implications.

One thing that would be nice is to allow moving a data pointer from one thread to another. In other words, as long as your data is contained, it can pass from one thread to another, and still be considered unshared.

Yes, that sounds plausible.

I think this is what you are talking about above, or is there something else?

You are right :).

Ola.

Reply via email to