- 博客(23)
- 资源 (1)
- 收藏
- 关注
原创 C#多线程编程笔记(5.1)-使用await操作符获取异步任务结果
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^本例将讲述使用异步函数的基本场景,比较使用TPL和使用await操作符获取异步操作结果的不同之处。using System;using System.Threading.Tasks;using System.Threading;using System.Dynamic;using Sys...
2018-06-29 10:41:26 7969
原创 C#多线程编程笔记(4.5)-并行运行任务(Task)
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^ using System;using System.Collections.Generic;using System.Threading.Tasks;using System.Threading;namespace 并行运行任务{ class Program { ...
2018-06-29 10:24:01 10264
原创 C#多线程编程笔记(4.4)-处理Task任务中的异常
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^
2018-06-27 15:25:05 10239 1
原创 C#多线程编程笔记(4.3)-Task任务中实现取消选项
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^ using System;using System.Threading.Tasks;using System.Threading;namespace 实现取消选项{ class Program { static void Main(string[] ...
2018-06-27 15:14:56 13200
原创 C#多线程编程笔记(4.2)-组合任务(Task)
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^ 本节将展示如何设置相互依赖的任务。我们将学习如何创建一个任务,使其在父任务完成后才会被运行。using System;using System.Threading.Tasks;using System.Threading;namespace 组合任务{ class Progr...
2018-06-26 10:34:46 9744
原创 C#多线程编程笔记(4.1)-使用Task任务
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^任务(Task)是什么?首先我们先了解一个概念, .Net Framework4.0引入了一个新的关于异步操作的API,叫任务并行库(Task Parallel Library,简称TPL),在.Net Framework4.5版,对该API进行了轻微的改进,使用更简单。TPL可被认为是线程池之...
2018-06-26 09:51:12 9571
原创 C#多线程编程笔记(3.5)-使用BackgroundWorker组件
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^本实例演示了另一种异步编程的方式,即使用BackgroundWorker组件。借助于该对象,可以将异步代码组织为一系列事件及事件处理器using System;using System.Threading;using System.ComponentModel;namespace 使用B...
2018-06-23 09:30:21 12417
原创 C#多线程编程笔记(3.4)-使用Timer计时器
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^using System;using System.Threading;namespace 使用计时器{ class Program { static void Main(string[] args) { Conso...
2018-06-23 09:14:00 12693
原创 C#多线程编程笔记(3.3)-在线程池中使用等待事件处理器及超时
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^using System;using System.Threading;namespace 在线程池中使用等待事件处理器及超时{ class Program { static void Main(string[] args) { ...
2018-06-23 09:04:21 12947
原创 C#多线程编程笔记(2.8)-使用SpinWait类
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^using System;using System.Threading;namespace SpinWait_Test{ class Program { static void Main(string[] args) { ...
2018-06-20 17:02:31 16119
原创 C#多线程编程笔记(2.7)-使用ReaderWriterLockSlim类
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^using System;using System.Collections.Generic;using System.Threading;namespace ReaderWriterLockSlim_Test{ class Program { stati...
2018-06-20 16:45:14 14422
原创 C#多线程编程笔记(2.6)-使用Barrier类
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^using System;using System.Threading;namespace Barrier_Test{ class Program { static void Main(string[] args) { ...
2018-06-20 15:02:45 14362
原创 C#多线程编程笔记(2.5)-使用CountDownEvent类
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^using System;using System.Threading;namespace CountDownEvent_Test{ class Program { static void Main(string[] args) { ...
2018-06-19 15:24:57 14654
原创 C#多线程编程笔记(2.4)-使用ManualResetEventSlim类
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^using System;using System.Threading;namespace ManualResetEventSlim_Test{ class Program { static void Main(string[] args) ...
2018-06-19 15:01:00 18267
原创 C#多线程编程笔记(2.3)-使用AuotResetEvent类
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^AuotResetEvent类可以通知等待的线程有某件事发生~using System;using System.Threading;namespace AuotResetEvent_Test{ class Program { static void Ma...
2018-06-19 14:42:33 14225
原创 C#多线程编程笔记(2.2)-使用SemaphoreSlim类
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^SemaphoreSlim是Semaphore的轻量级版本,该类限制了同时访问同一个资源的线程数量using System;using System.Threading;namespace semaphoreSlim_Test{ class Program { ...
2018-06-19 11:18:18 15131
原创 C#多线程编程笔记(2.1)-使用Mutex类
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^Mutex是一种原始的同步方法,其只对一个线程授予对共享资源的独占访问using System;using System.Threading;namespace MutexTest{ class Program { static void Main(str...
2018-06-19 10:25:35 14198
原创 C#多线程编程笔记(1.4)-对Exception的异常处理
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^using System;using System.Threading;namespace 异常处理{ class Program { static void Main(string[] args) { var t ...
2018-06-19 09:49:09 14285
原创 C#多线程编程笔记(1.3)-死锁(Dead Lock)解决方法
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^using System;using System.Threading;namespace 死锁{ class Program { static void Main(string[] args) { object l...
2018-06-15 14:22:04 16397
原创 C#多线程编程笔记(1.2)-检测线程状态State
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^using System;using System.Threading;namespace 检测线程状态{ class Program { static void Main(string[] args) { Cons...
2018-06-15 11:12:43 16933
原创 C#多线程编程笔记(3.1)-线程池ThreadPool与并行度
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^using System;using System.Threading;using System.Diagnostics;namespace 线程池与并行度{ class Program { static void Main(string[] args)...
2018-06-15 10:29:51 14559
原创 C#多线程编程笔记(3.2)-CancellationToken取消异步操作
近来在学习Eugene Agafonov编写的《C#多线程编程实战》(译),做些笔记也顺便分享一下^-^using System;using System.Threading;namespace 线程池中取消异步操作{ class Program { static void Main(string[] args) { using(var...
2018-06-15 10:06:28 21483
原创 CMD指令-连接局域网主机
熟悉Windows操作系统的人都清楚,cmd.exe命令行程序是一个非常基础也非常好用的程序。本篇主要针对和我一般刚入行的小萌新,分享一个关于如何获取局域网内其余主机IP地址及连接的方法,也是本萌新在工作中发现的,觉得挺有意思,特地分享,欢迎指点~1、首先,我们得对一些cmd下的指令有所了解ping ping -a IP地址 → 主机域名 ...
2018-06-14 16:55:13 31038
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人