By: Konrad Schwarz (no.spam.delete@this.no.spam), December 10, 2014 6:23 am
Room: Moderated Discussions
Eric Bron (eric.bron.delete@this.zvisuel.privatefortest.com) on December 6, 2014 2:42 am wrote:
> > Trust me, concurrency is hard. There's a reason all the examples of "look how easy it is to parallellize
> > things" tend to use simple arrays and don't ever have allocations or freeing of the objects.
>
> or people using DAGs to explain why reference count is a solid
> solution when complex object graphs typically have cycles
And this really clinches the argument: to use reference counts, you need acyclic (directed) graphs.
Locking hand over hand from roots to leaves of such graphs is not susceptible to deadlock,
unless two or more threads each lock more than one root concurrently.
> > Trust me, concurrency is hard. There's a reason all the examples of "look how easy it is to parallellize
> > things" tend to use simple arrays and don't ever have allocations or freeing of the objects.
>
> or people using DAGs to explain why reference count is a solid
> solution when complex object graphs typically have cycles
And this really clinches the argument: to use reference counts, you need acyclic (directed) graphs.
Locking hand over hand from roots to leaves of such graphs is not susceptible to deadlock,
unless two or more threads each lock more than one root concurrently.