线程
Joetao
正在从事.net silverlight地图方面的工作!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
等待异步委托的方式
<br /> 等待异步委托的几种方式,觉得这个比较重要的,如是学习了下,把学习笔记记录如下<br />(一)代码:<br />using System; using System.Collections.Generic; using System.Linq; using System.Text; //添加命名空间 using System.Threading; using System.Diagnostics; namespace 线程和同步 { //创建线程方式原创 2010-10-12 16:58:00 · 1511 阅读 · 0 评论 -
线程同步:Event类
<br /> 本篇学习了使用ManaualResetEvent和AutoResetEvent类实现线程同步的方案。<br />(一)代码如下:<br />using System; using System.Collections.Generic; using System.Linq; using System.Text; //添加命名空间 using System.Threading; //Events类实现线程同步 //AutoResetEvent和Manual原创 2010-10-13 15:59:00 · 1210 阅读 · 0 评论 -
线程中的竞态条件的问题
本篇是我学习竞态条件的笔记。笔记如下:(一)代码:using System; using System.Collections.Generic; using System.Linq; using System.Text; //添加命名空间 using System.Threading; using System.Diagnostics; namespace ThreadProblem { //竞态条件:如果两个或多个线程访问相同的对象,或者不同原创 2010-10-13 09:45:00 · 1496 阅读 · 0 评论 -
线程中死锁的问题
本篇是我学习线程中死锁问题的笔记,笔记如下:(一)代码:using System; using System.Collections.Generic; using System.Linq; using System.Text; //添加命名空间 using System.Threading; using System.Diagnostics; namespace DeathLock { //死锁产生的原因:由于两个线程都在等待对方,就出现了死锁,线程将无限等待下去。原创 2010-10-13 11:11:00 · 1222 阅读 · 0 评论 -
线程同步:旗语(Semaphore)
<br />using System; using System.Collections.Generic; using System.Linq; using System.Text; //添加命名空间 using System.Threading; using System.Diagnostics; //旗语(Semaphore)锁定非常类似于互斥锁定,其区别是,旗语锁定可以同时由多个线程使用。 //旗语锁定是一种计数的互斥的锁定 //使用旗语锁定,可以定义允许同时访问受旗语访锁定保护原创 2010-10-14 15:14:00 · 2612 阅读 · 0 评论 -
基于事件的异步模式
本篇学习了基于事件的异步模式。问题的提出:基于IAsyncResult接口的异步模式.在异步回调中,回调线程不同于调用线程。使用Windows窗体或WPF时,这就是个问题,因为Windows窗体和WPF控件绑定到一个线程上。对于每个控件,都只能从创建该控件的线程中调用方法,也就是说后台线程不能直接在这个线程中访问UI控件解决办法(1):在Windows窗体中,唯一可以从非创建线程中调用的方法是Invoke()、BeginInvoke()、EndInvoke()和属性InvokeRequi原创 2010-10-14 16:24:00 · 2831 阅读 · 0 评论
分享