码迷,mamicode.com
首页 >  
搜索关键字:threading    ( 3244个结果
python_threading模块
#!/usr/bin/python #coding=utf-8 importthread fromtimeimportsleep,ctime loops=[3,5] #测试函数 defloop(nloop,nsec,lock): print‘startloop‘,nloop,‘at‘,ctime() sleep(nsec) print‘loop‘,nloop,‘doneat‘,ctime() lock.release() ‘‘‘ defmain() print‘startat‘.ctime() #lo..
分类:编程语言   时间:2015-05-14 20:46:23    阅读次数:129
Python3.4 threading socket 学习
#!/usr/bin/env python3#file name: threadtest.py# -*- coding:utf8 -*-# -version:1.0-import threading, time, socketclass Server(): '''接收消息的服务器类''' def _...
分类:编程语言   时间:2015-05-14 13:54:30    阅读次数:199
12. C# -- Main()函数
usingSystem; usingSystem.Collections.Generic; usingSystem.Linq; usingSystem.Text; usingSystem.Threading.Tasks; namespaceConsoleApplication1 { classProgram { //Main()是C#应用程序的入口点,执行这个函数就是执行应用程序;在Main()函数中执行完毕,执行过程就结束了..
分类:Windows程序   时间:2015-05-14 12:18:01    阅读次数:172
13. C# --结构函数
usingSystem; usingSystem.Collections.Generic; usingSystem.Linq; usingSystem.Text; usingSystem.Threading.Tasks; namespaceConsoleApplication1 { classProgram { //定义结构函数 structcustomerName { publicstringfirstName,lastName; publicstringname() { returnfirst..
分类:Windows程序   时间:2015-05-14 12:17:33    阅读次数:146
10.C# -- 函数参数,参数数组,值传递函数,引用传递函数,输出函数,无参函数
usingSystem; usingSystem.Collections.Generic; usingSystem.Linq; usingSystem.Text; usingSystem.Threading.Tasks; namespaceConsoleApplication1 { classProgram { staticintval; //函数 //1.关键字static:静态函数,void:无返回值,return:程序立即返回调用代码; //实例..
分类:编程语言   时间:2015-05-13 17:14:36    阅读次数:116
11. C# -- 全局变量,局部变量
usingSystem; usingSystem.Collections.Generic; usingSystem.Linq; usingSystem.Text; usingSystem.Threading.Tasks; namespaceConsoleApplication1 { classProgram { staticstringmyString; staticvoidWrite() { stringmyString="StringdefinedinWrite()"; Console.WriteLin..
分类:Windows程序   时间:2015-05-13 13:06:26    阅读次数:132
[转]C# 多线程的等待所有线程结束的一个问题
using System; using System.Threading; namespace ConsoleApplication1 { class Program { private static AutoResetEvent[] events; static void Main(string[...
分类:编程语言   时间:2015-05-13 09:54:49    阅读次数:257
threading 模块
threading模块里面主要是对一些线程的操作对象化了,创建了Thread class。使用线程有两种模式,一种是创建线程要执行的 函数,把这个函数传递进Thread对象里,让它来执行;另一种是直接从Thread继承,创建一个新的class,把线程执行的代码放到这个新的 class里。 1 __a...
分类:其他好文   时间:2015-05-13 00:24:05    阅读次数:163
C#多线程开发4:线程的Abort和ResetAbort方法
使用Abort方法可以中止线程,而使用ResetAbort方法可以取消中止线程的操作。 下面的实例演示了Abort和ResetAbort方法的使用。 using System; using System.Threading; namespace AbortAndResetabortExp { class Program { static void Main(st...
分类:编程语言   时间:2015-05-12 23:03:31    阅读次数:155
c#中的结构与枚举
结构与c++不同的是,结构应该定义在命名空间或者类里面,成员变量叫字段,字段并且有访问控制符,每个字段前要加一个下划线例子using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;namespace 结构 { public...
分类:Windows程序   时间:2015-05-12 21:02:09    阅读次数:166
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!