using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;using System.Threading.Tasks;namespace AsyncDelegateExam{ delegate int TakeAWhileDelegate(int data,int ms); class Program { stati…
提交任务的两张方式: 1.同步调用 2.异步调用 同步调用:提交完任务后,就在原地等待任务执行完后,拿到结果,再执行下一行代码 同步调用,导致程序串行执行 from concurrent.futures import ThreadPoolExecutor import time import random def la(name): print("%s is 正在拉" % name) time.sleep(random.randint(1,3)) res = random.randin…