Idea for Threads
Frits van Bommel
fvbommel at REMwOVExCAPSs.nl
Sun May 13 11:42:59 PDT 2007
Martin Persenius wrote:
> Frits,
>
> You (I) learn something new everyday - thanks!
You're welcome.
> What do you think about types with automatic locking then? Not specifically my fouled up attempt.
It's a nice idea, but probably not easy to implement in a way that's
intuitively "right".
If the type has multiple fields, for example, you might want to keep the
lock over multiple accesses. I'm not sure if that can be done nicely in
the current language.
If "smart references" (akin to C++ "smart pointers") were possible that
could be a good way to implement it though. But overloading "." is
currently not possible...
> I suppose I need to become more familiar with the exact details of the problems to be overcome in threading.
I'm not terribly familiar with them either. I just noticed a race
condition :).
More information about the Digitalmars-d
mailing list