Thread Control Block
Thread Control Block
The following is the declaration of the Thread Control Block.
struct tcb {
u32_t status;
struct reg_context thread_context;
void *stack;
struct thread_info thread_params;
u32_t executedTime;
struct tcb *recoveryTask;
u32_t sched_field;
u32_t magic_key;
};
- unsigned int status
This field holds the status information of the current thread. It can be one of THREAD_ON_CPU, THREAD_READY, THREAD_SUSPENDED THREAD_BLOCKED, THREAD_EXITED or THREAD_MISSED_DEADLINE.
This field is not directly updated by the kernel. The kernel thread library informs the scheduler about the status of a thread through the Scheduler API. It is upto the scheduler object to keep this field consistent. For example when a thread exits, the kernel calls the function set_mode(curr_thread,THREAD_EXITED) of the scheduler API. This approach of calling a scheduler function to update the status helps, when the sheduler needs to do additional work (apart from setting it's status) whenever the status of a thread changes. For example, for periodic threads, it might reset them when they exit.
- struct reg_context thread_context
This structure stores the context of a thread. The structure reg_context is architecture specific. This field is accessed by the kernel thread library only. (The scheduler object should not mess with it).
- struct thread_info thread_params
This field holds the initial thread parameters, like the start function, stack size, deadline etc. This information is required for resetting threads.
- void * stack
This field is a pointer to the stack of the thread.
- u32_t executedTime
This field can be used for keeping profiling information for the thread. This is currently not being used.
- u32_t sched_field
This field is meant for use by the scheduler object. The kernel never accessed this field.
Typically this field will be used by the scheduler object for constructing datastructure of tcb's. For example if the scheduler object stores the ready threads in a list, this field would be used as next pointer.
- u32_t magic_key
This field is used for debugging and should go away in the final release.
http://www.cse.iitd.ernet.in/~soumyadeb/projects/mtp/report/node56.html
Thread Control Block的更多相关文章
- Thread control block & thread
https://en.wikipedia.org/wiki/Thread_control_block Thread Control Block (TCB) is a data structure in ...
- 【APUE】Chapter12 Thread Control
今天看了APUE的Chapter12 Thread Control的内容,记录一下看书的心得与示例code. 这一章的内容是对Chapter11 Threads(见上一篇日志)的补充,大部分内容都是理 ...
- P4语法(4)Control block
Control block Control block之中用于放置设计好的Table和Action. 可以把control block认为是pipeline的一个模板,之前用的v1model中就是in ...
- CUDA中确定你显卡的thread和block数
CUDA中确定你显卡的thread和block数 在进行并行计算时, 你的显卡所支持创建的thread数与block数是有限制的, 因此, 需要自己提前确定够用, 再进行计算, 否则, 你需要改进你的 ...
- 【并行计算-CUDA开发】CUDA编程——GPU架构,由sp,sm,thread,block,grid,warp说起
掌握部分硬件知识,有助于程序员编写更好的CUDA程序,提升CUDA程序性能,本文目的是理清sp,sm,thread,block,grid,warp之间的关系.由于作者能力有限,难免有疏漏,恳请读者批评 ...
- 进程控制块(Process Control Block, PCB)
是为了管理进程设置的一个数据结构.是系统感知进程存在的唯一标志.通常包含如以下的信息:(1)进程标识符(唯一)(2)进程当前状态,通常同一状态的进程会被放到同一个队列:(3)进程的程序和数据地址(4) ...
- 线程的简述Thread
为什么有进程? 原来操作系统只能处理一件任务,有了进程就可以让操作系统处理多个任务.因为进程与进程之间是完全隔离的,涉及到了内存空间.数据的切换,所以就有了进程的概念. 已经有了进程,为什么还要线程? ...
- Windows内核 基本数据结构
驱动对象: 每个驱动程序都会有唯一的驱动对象与之对应,并且这个驱动对象是在驱动加载时被内核中的对象管理程序所创建的.驱动对象用DRIVER_OBJECT数据结构表示,它作为驱动的一个实例被内核加载,并 ...
- CMSIS OS None
/* ---------------------------------------------------------------------- * Copyright (C) 2011 ARM L ...
随机推荐
- 记一次redis-cluster的切换
# redis-cli -h 10.5.8.18 -c -p 8001 cluster nodes|grep master 6d2f817064a10631648f24f450a37237b3d53f ...
- .net基础总复习(1)
第一天 1.new关键字 (1) 创建对象 (2) 隐藏从父类那里继承过来的成员 2.访问修饰符 public: 公开的,公共的. private:私有的,只能在当前类的内部访问,类中的成员, 如果不 ...
- java几种读写文件的方式
java.io的几种读写文件的方式 一.java把这些不同来源和目标的数据都统一抽象为数据流. Java语言的输入输出功能是十分强大而灵活的. 在Java类库中,IO部分的内容是很庞大的,因为它涉及的 ...
- WEB开发兼容性---浏览器渲染模式—— document.compatMode
document.compatMode主要是用来判断浏览器采用何种方式渲染,它有两种可能的返回值:BackCompat和CSS1Compat,官方对其解释如下: BackCompat:标准兼容模式关闭 ...
- php获取时间是星期几
PHP星期几获取代码: date("l"); //data就可以获取英文的星期比如Sundaydate("w"); //这个可以获取数字星期比如123,注意0是 ...
- 五大最佳开源java性能监控工具
如果你正在寻找性能监控工具,不妨看看以下推荐的这五款开源工具,这些工具目前已经可以替代付费工具了,你可以看看是否是你的最佳选择.本文推荐的五款开源工具目前是开源社区中最受欢迎的. 1. Stagemo ...
- 自己定义控件-MultipleTextView(自己主动换行、自己主动补齐宽度的排列多个TextView)
一.功能: 1.传入一个 List<String> 数组,控件会自己主动加入TextView,一行显示不下会自己主动换行.而且把上一行末尾的空白通过拉伸而铺满. 2.配置灵活 <co ...
- server.htaccess 具体解释以及 .htaccess 參数说明
.htaccess文件(或者"分布式配置文件")提供了针对文件夹改变配置的方法. 即.在一个特定的文档文件夹中放置一个包括一个或多个指令的文件, 以作用于此文件夹及其所有子文件夹. ...
- ioctl.h 分析
ioctl.h 分析 我自己画了个解析图...不要嫌弃丑啊.. . 哈哈 type The magic number. Just choose one number (after consulting ...
- hibernate之4.延迟载入
延迟载入: 仅仅有当使用以实体对象的属性(除主键属性外)时,才会发送查询语句到数据库 get不支持延迟载入 @Test public void getTest(){ Session session=n ...