pub fn execute_with_max_available_threads<T>(f: impl FnOnce() -> T + Send) -> T