[e-lang] Deadlock and datalock
david.nospam.hopwood at blueyonder.co.uk
Wed Jul 5 23:56:59 EDT 2006
David Hopwood wrote:
> Here is an interesting subthread on comp.programming.threads [*] about
> deadlock and datalock:
> This artificial example of a nondeterministic datalock was interesting
> (s1..3 are synchronous channels here, but they could as easily be promises):
Sorry, they couldn't be promises, because promises are single-assignment.
They could be MVars (where the value is set back to null/unbound by reading).
> A1: read s1; write s2; read s2; read s3
> A2: write s1; read s2; write s2; write s3
> I seemed to make some progress in explaining the difference between
> datalock and deadlock:
> [*] c.p.threads is normally very shared-state concurrency-oriented, mainly
> discussing pthreads (and sometimes lock-free techniques), with considerable
> skepticism toward message passing.
David Hopwood <david.nospam.hopwood at blueyonder.co.uk>
More information about the e-lang