c#中多线程与多任务区别_如何在C#中对任务使用多线程

c#中多线程与多任务区别The computer programming term "thread" is short forthreadof execution, in which a processor follows a specified path through your code. The concept of following more than one thread at ...
摘要由CSDN通过智能技术生成

c#中多线程与多任务区别

The computer programming term "thread" is short for thread of execution, in which a processor follows a specified path through your code. The concept of following more than one thread at a time introduces the subject of multi-tasking and multi-threading.

计算机编程术语“线程”是执行线程的缩写,其中处理器遵循代码中的指定路径。 一次跟踪多个线程的概念引入了多任务和多线程的主题。

An application has one or more processes in it. Think of a process as a program running on your computer. Now each process has one or more threads. A game application might have a thread to load resources from disk, another to do AI, and another to run the game as a server.

一个应用程序中包含一个或多个进程。 可以将进程视为在计算机上运行的程序。 现在,每个进程都有一个或多个线程。 一个游戏应用程序可能具有一个线程来从磁盘加载资源,另一个可以执行AI,另一个可以作为服务器运行游戏。

In .NET/Windows, the operating system allocates processor time to a thread. Each thread keeps track of exception handlers and the priority at which it runs, and it has somewhere to save the thread context until it runs. Thread context is the information that the thread needs to resume.

在.NET / Windows中,操作系统将处理器时间分配给线程。 每个线程都会跟踪异常处理程序及其运行的优先级,并且在某个地方可以保存线程上下文,直到运行为止。 线程上下文是线程需要恢复的信息。

线程多任务 ( Multi-Tasking With Threads )

Threads take up a bit of memory and creating them takes a little time, so usually, you don't want to use many. Remember, they compete for processor time. If your computer has multiple CP

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值