2015年5月30日

摘要: 我们经常会遇到生产者消费者模式,比如前端各种UI操作事件触发后台逻辑等。在这种典型的应用场景中,我们可能会有4个业务处理逻辑(下文以P代表生产者,C代表消费者): 1. FIFO(先进先出) P产生1,2,3,4,5,6,3,2 C处理顺序应为1,2,3,4,5,6,3,2 2.LIFO(后进先出) P产生1,2,3,4,5,6,3,2 C处理顺... 阅读全文
posted @ 2015-05-30 16:31 Redvelvet 阅读(496) 评论(0) 推荐(0)
 
摘要: private static void tt2() { Task task = null; for (int i = 0; i < 10; i++) { task = Task.Factory.StartNew(callback, i); } ... 阅读全文
posted @ 2015-05-30 15:52 Redvelvet 阅读(379) 评论(0) 推荐(0)

2015年5月29日

摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { publ... 阅读全文
posted @ 2015-05-29 19:44 Redvelvet 阅读(1601) 评论(0) 推荐(0)