using System; using System.Web; using System.Web.UI; using System.IO; using System.Threading; namespace HuoLi.Common { /// <summary> /// file 的摘要说明。 / ...
线程队列 FIFO队列 LIFO 栈 优先级队列 事件Event 使用threading库中的Event对象。 对象包含一个可由线程设置的信号标志,它允许线程等待某些事件的发生。在 初始情况下,Event对象中的信号标志被设置为假。如果有线程等待一个Event对象, 而这个Event对象的标志为假, ...
分类:
其他好文 时间:
2020-03-01 10:29:31
阅读次数:
48
import threading import time from datetime import datetime as dt def say_hello(word): time.sleep(1) print(word) pool = [] now = dt.now() for x in rang ...
分类:
编程语言 时间:
2020-02-25 20:28:23
阅读次数:
66
#线程锁 又叫 互斥锁(Mutex) import threading,time def run(n): lock.acquire() #申请锁 global num num+=1 time.sleep(1) lock.release() #释放锁 lock = threading.Lock() # ...
分类:
编程语言 时间:
2020-02-24 17:06:28
阅读次数:
97
using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks ...
分类:
其他好文 时间:
2020-02-23 19:50:00
阅读次数:
63
from lxml import etree import requests from urllib import request import time import os from queue import Queue import threading import re from multip ...
分类:
编程语言 时间:
2020-02-23 16:15:47
阅读次数:
147
import requestsimport parselimport timeimport threading# 模拟浏览器headers = {"Referer": "https://maoyan.com/board/4?offset=0", "User-Agent": "Mozilla/5.0 ...
分类:
编程语言 时间:
2020-02-23 09:56:39
阅读次数:
70
一、引言 我们先来看下面的一个小示例:一个Winfrom程序,界面上有一个按钮,有两个异步方法,点击按钮调用两个异步方法,弹出执行顺序,代码如下: using System; using System.Threading; using System.Threading.Tasks; using Sy ...
分类:
其他好文 时间:
2020-02-22 00:08:50
阅读次数:
55
一、前言 我们先来看下面一个例子: using System; using System.Threading; namespace ThreadSynchDemo { class Program { private static int Counter = 0; static void Main(s ...
分类:
编程语言 时间:
2020-02-20 15:19:12
阅读次数:
53
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace _13_out参数练 ...
分类:
其他好文 时间:
2020-02-17 20:18:50
阅读次数:
78