 The main problems with this approach is that the release code (most commonly in a codice_6 clause) may be very distant from the acquisition code (it lacks "adjacency"), and that the acquisition and release code must always be paired by the caller (it lacks "encapsulation").These can be remedied either functionally, by using closures/callbacks/coroutines (Common Lisp, Ruby, Scheme), or by using an object that handles both the acquisition and release, and adding a language construct to call these methods when control enters and exits a scope (C# codice_17, Java codice_7-with-resources, Python codice_14); see below.An alternative, more imperative approach, is to write asynchronous code in direct style