惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
大猫的无限游戏
大猫的无限游戏
Cyberwarzone
Cyberwarzone
T
Troy Hunt's Blog
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
U
Unit 42
Last Week in AI
Last Week in AI
云风的 BLOG
云风的 BLOG
F
Full Disclosure
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google DeepMind News
Google DeepMind News
Hacker News - Newest:
Hacker News - Newest: "LLM"
IT之家
IT之家
Google Online Security Blog
Google Online Security Blog
Cloudbric
Cloudbric
月光博客
月光博客
Hacker News: Ask HN
Hacker News: Ask HN
罗磊的独立博客
N
News and Events Feed by Topic
S
Secure Thoughts
The Last Watchdog
The Last Watchdog
Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
Hugging Face - Blog
Hugging Face - Blog
I
Intezer
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 聂微东
P
Privacy International News Feed
有赞技术团队
有赞技术团队
博客园_首页
F
Fortinet All Blogs
Recent Announcements
Recent Announcements
O
OpenAI News
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tor Project blog
B
Blog
量子位
T
Threatpost
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Vulnerabilities – Threatpost
酷 壳 – CoolShell
酷 壳 – CoolShell
S
SegmentFault 最新的问题
L
LangChain Blog

博客园 - luckyzmw

ASP.net里大文件上传的问题讨论 E680最强综合技巧集合 E680I常用工具和使用说明 Code Snippet Libraries压缩下载包 企业库中的一个小发现 企业库中的objectBuild类分析 企业库core中configuration部分类的分析 如何创建一个自定义帐户来运行 ASP.NET 新手学习XSL的好东西 UML相关的工具 广告管理系统的UML分析与设计 几家最好的IT公司面试全揭秘 ASP.NET常用代码 NameValueCollection的用法 Microsoft Windows Workflow Foundation 入门:开发人员演练 为何使用表格排版是不明智的 Fitch and Mather 7.0 概述 MAVERICK.NET好用吗 ASP.NET下MVC设计模式的实现
多线程的简单示例
luckyzmw · 2005-12-13 · via 博客园 - luckyzmw

看企业库的ConfigurationChangeWatcher,里面用了多线程,自己以前没有写过,写了一个小demo,最简单的,分享一下:

        [STAThread]
        
static void Main(string[] args)
        
{
            System.Threading.Thread t 
= new System.Threading.Thread(new System.Threading.ThreadStart(test));
            t.Start();
            System.Threading.Thread.Sleep(
500);
            
for (int i = 0 ; i < 1000 ; i++)
            
{
                Console.WriteLine(
"main");
                System.Threading.Thread.Sleep(
1000);
            }


        }


        
static void test()
        
{
            
for (int i = 0 ; i < 1000 ; i++)
            
{
                Console.WriteLine(
"test");
                System.Threading.Thread.Sleep(
1000);
            }

        }

    }