Every single thread has the follow elements:

  1. Execution Context:Every thread has a execution context which maintains some basical data about the running of the thread, like windows identity information, pricipal ,etc.One important thing about execution context is,when a thread create another thread (say,to do some work asynchronously), the execution context will "flow" from main thread to the sub-thread to let it run just like the main thread do.You can say that a "execution context inherit". You can stop this by calling the System.Threading.ExecutionContext.SuppressFlow() static method, that will help improve the performance.
  2. Thread Kernel Object:TKO is a data structure.Everytime when a thread is created,a TKO will be assigned and initialized.TKO maintains a property of descriping the thread, and thread context.
  3. Thread Environment Block,which is related to exception.
  4. User-Mode Stack: this stack stores the local variables and arguments in the method,and the returnning address of the method,so the thread can move on from this address when returned from the method.
  5. Kernel-Mode Stack:a stack which managed by OS kernel function.
  6. Thread context switch causes a bad performence.Here is how a context switch work :OS will move the data on CPU's register to the current thread's context, then move the target thread's context data into the cpu register so that the cpu can do its work.

Thread in depth 1: The basic的更多相关文章

  1. Thread in depth 4:Synchronous primitives

    There are some synchronization primitives in .NET used to achieve thread synchronization Monitor c# ...

  2. Thread in depth 3:Synchronization

    Synchronization means multi threads access the same resource (data, variable ,etc) should not cause ...

  3. Thread in depth 2:Asynchronization and Task

    When we want to do a work asynchronously, creating a new thread is a good way. .NET provides two oth ...

  4. [linux basic 基础]----线程的属性

    在信号量和互斥量例子中,我们都是在程序推出之前利用pthread_join对线程进行再次同步:如果想让thread想创建它的线程返回数据我需要这么做:问题:我们有时候既不需要第二个线程向main线程返 ...

  5. TAxThread - Inter thread message based communication - Delphi

    http://www.cybletter.com/index.php?id=3 http://www.cybletter.com/index.php?id=30 Source Code http:// ...

  6. Fusion-io ioDrive Duo Enterprise PCIe Review

    原文地址:http://www.storagereview.com/fusionio_iodrive_duo_enterprise_pcie_review As part of StorageRevi ...

  7. java 锁!

    问题:如何实现死锁. 关键: 1 两个线程ta.tb 2 两个对象a.b 3 ta拥有a的锁,同时在这个锁定的过程中,需要b的锁:tb拥有b的锁,同时在这个锁定的过程中,需要a的锁: 关键的实现难点是 ...

  8. java命令行HPROF Profiler

    The HPROF Profiler The Heap and CPU Profiling Agent (HPROF)是JAVA2 SDK自带的一个简单的profiler代理,它通过与Java Vir ...

  9. Java Concurrency - 线程执行器

    Usually, when you develop a simple, concurrent-programming application in Java, you create some Runn ...

随机推荐

  1. appium -ios 真机连接 环境搭建

    补充点一: 安装ios-deploynpm install -g ios-deploy 安装不了报错.! 后来找了找,发现sudo npm install -g ios-deploy --unsafe ...

  2. Samba服务创建共享文件系统

    Linux 系统中的Samba Linux系统中的Samba服务器又提供了另外一种技术来弥补这种安全性的不足的技术,那就是采用账户映射方式为Samba服务器提供虚拟账户(不与Linux系统中的用户账户 ...

  3. 深入理解 Express.js

    本文针对那些对Node.js有一定了解的读者.假设你已经知道如何运行Node代码,使用npm安装依赖模块.但我保证,你并不需要是这方面的专家.本文针对的是Express 3.2.5版本,以介绍相关概念 ...

  4. 第5课 Qt Creator工程介绍

    1. QT Creator工程管理(一个工程包含不同类型的文件) (1).pro项目文件 (2).pro.user用户配置描述文件 (3).h头文件 (4).cpp源文件 (5).ui界面描述文件 ( ...

  5. 【POJ】1185 炮兵阵地(状压dp)

    题目 传送门:QWQ 分析 看到$ M<=10 $考虑状压. 然后把每行都压一下,那么每个状态相关的就是上一行和上上行的状态. 然后枚举. 然后复杂度最坏是$ O(100 \times 1024 ...

  6. SQOOP 添加oracle 驱动

      我的ORACLE 是11G  ,找到ojdbc6.jar,放到sqoop 的lib 下面,我的是cloudera 集群,目录是 /opt/cloudera/parcels/CDH-5.10.0-1 ...

  7. sdm 使用阿里云域名申请 Let’s Encrypt 通配符 域名证书

    安装acme 进入 套件中心 点击安装 Git Server 之后进入SSh会使用git命令 方法1--------------------------------------- 获取代码 git c ...

  8. python's @property

    [python's @property] 参考:http://docs.python.org/3/library/functions.html?highlight=property#property

  9. 理解ServletRequest和ServletResponse

    博客地址:http://blog.51cto.com/lavasoft/275586

  10. Python all() 函数

    Python all() 函数  Python 内置函数 描述 all() 函数用于判断给定的可迭代参数 iterable 中的所有元素是否都为 TRUE,如果是返回 True,否则返回 False. ...