Streams Instead of Locks

Instead of protecting access to a resource with a lock, we can turn it into a port/stream based concurrent service: