promise: add max_available_thread_idx() interface