using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Ch1{ public delegate void ...
多态:即多种表现形态首先定义一个Person父类using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Conso...
分类:
其他好文 时间:
2014-12-17 20:38:18
阅读次数:
139
如何控制好多个线程相互之间的联系,不产生冲突和重复,这需要用到互斥对象,即:System.Threading 命名空间中的 Mutex 类。我们可以把Mutex看作一个出租车,乘客看作线程。乘客首先等车,然后上车,最后下车。当一个乘客在车上时,其他乘客就只有等他下车以后才可以上车。而线程与Mutex...
分类:
编程语言 时间:
2014-12-17 10:34:59
阅读次数:
210
using System;using System.Collections.Generic;using System.Data;using System.Linq;using System.Text;using System.Threading.Tasks;namespace RemoveDupRo...
分类:
其他好文 时间:
2014-12-17 09:42:03
阅读次数:
180
threading.Thread 并没有显式的提供获取线程调用函数返回值的方法,需求自己实现。
使用数据库是一个办法: 可以让子线程将数据写到数据库中,消费线程再去数据库中读取数据;
如果不想用数据库,可以使用类的全局变量来做传递,
示例代码如下:
import os
import threading
class SubThread():
data = {}
...
分类:
编程语言 时间:
2014-12-16 22:39:16
阅读次数:
325
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;using System.Threading.Tasks;using System.Win...
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication2{ class...
分类:
其他好文 时间:
2014-12-15 16:55:55
阅读次数:
123
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace webpro
{
publ...
1.简述 一般一个程序一个进程,代码是存在进程中的,进程本身不执行代码, 执行代码的是线程。 一般一个进程里就一个线程。(一个商店就一个老板娘。) 进程就是在内存中开辟了一个空间。代码,图片。。等就存在这个空间里。代码线程去执行。 默认只有一个线程。systerm.threading //...
分类:
编程语言 时间:
2014-12-12 13:07:25
阅读次数:
141
---恢复内容开始---//注释一行using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;//命名空间namespace first...