We have seen how it is possible, once again using the library construction mechanisms of object technology, to express coroutines based on the general concurrent mechanism. It is necessary to support the reuse of existing, non-concurrent software, especially libraries of reusable software components. Such encapsulation seems useful, however, and may be an unescapable consequence of the semantic differences between sequential and concurrent computation. Also note that such wrapper classes are easy to write. One area in which more work remains necessary is how to guarantee deadlock avoidance.
Deadlock potential is a fact of concurrent life.
The solution lies partly in the use of high-level encapsulation mechanisms. This is, in my experience, the best recipe for deadlock avoidance. This approach may not be sufficient, however, and it may be possible to devise simple non-deadlock rules, automatically checkable by a static tool. But more is needed. All rights reserved.