Windows8 ThreadPool 笔记

摘要: private int interLocked = 9; private int lockInt = 19; private object lockObj = new object();private Semaphore semaphore = new Semaphore(2, 2); public MainPage() { this.InitializeComponent(); } protected override void OnNavigatedTo(Navigation... 阅读全文
posted @ 2013-03-27 11:00 JackSlaterYu 阅读(206) 评论(0) 推荐(0) 编辑

Unsafe && Fixed 关键字

摘要: class CaryData { public int data; } class Program { unsafe static void ChangeValue(int* pInt) { *pInt = 23; } unsafe public static void Main() { CaryData c = new CaryData(); Console.WriteLine("改变前: {0}", c.dat... 阅读全文
posted @ 2013-03-27 10:53 JackSlaterYu 阅读(165) 评论(0) 推荐(0) 编辑

EventWaitHandle 用法

摘要: 1 //class Program 2 //{ 3 // static EventWaitHandle[] ewhs; 4 // static void UserResource(object o) 5 // { 6 // int i = (int)o; 7 // ewhs[i].WaitOne(); 8 // Console.WriteLine("get resource" + Thread.CurrentThread.Name); 9 // T... 阅读全文
posted @ 2013-03-27 10:48 JackSlaterYu 阅读(251) 评论(0) 推荐(0) 编辑