See pool_intf.ml for documentation.