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 ...
随机推荐
- 服务端 | Nodejs 学习笔记(一)
Node.js 前言: 2009年面世 nodejs.org 官网 https://www.npmjs.com/ 模块社区 github.com 仓库 stackoverflow.com 问答社区 ...
- js从数组中取出n个不重复的数据
/** * 首先,针对这个数组做一个去重处理,避免你在后面取数据的时候,因为取到相同的元素而又要多去取一次随机数 * 将获取到的不重复的数组,再到这里样本里面去取随机数 * 每取到一次,就将这个元素从 ...
- GRpc-Go使用笔记
linux下配置GRpc-golang 1.git中下载protobuf包 2.解压(/usr/local/protobuf) unzip protobuf-cpp-3.0.0-alpha-3.z ...
- input输入框只允许输入数字
/* input输入框只允许输入数字*/ <input type="text" onkeypress="keyPress()" > function ...
- luoguP2742 【模板】二维凸包 / [USACO5.1]圈奶牛 二维凸包
我们知道,纵坐标最小的点一定在凸包上(如果有多个,那它们都会被取到) 随便找一个纵坐标最小的点,将其他所有点按照这个点为原点极角排序,我们发现极角大的会在极角小的后面加入(感性认知一下) 考虑新(加入 ...
- uboot的readme导读
UBOOT的移植其实并没有想象中的难,这主要归功于众多的工程师已经将常见的平台代码写入了UBOOT,我们所要做的就是一点小小的更改,在网上看了很多相关的移植,也听到有人说其实看了UBOOT的readm ...
- VUE:路由
VUE:路由 一.说明 1)官方提供的用来实现SPA的vue插件 2)github:https://github.com/vuejs/vue-router 3)中文文档:http://router.v ...
- git 简单理解
现在git这个版本控制大行其道,弄了半天大概理解了一下他的工作原理. 使用流程 1,安装git ,小乌龟,小乌龟汉化(在设置里面第一项,检查更新,下载中文包安装) 2,设置 小乌龟 ->git ...
- 【codeforces 630E】A rectangle
[题目链接]:http://codeforces.com/problemset/problem/630/E [题意] 给你一个矩形的区域; 然后让你统计这个矩形区域内,有多少个正六边形. [题解] 规 ...
- ASP.NET-model验证
在ASP.NET的model中,可以定义下面的这种属性,来实现前台签证字符串 RegularExpression(@"(|.*(?=.{6,})(?=.*\d)(?=.*[a-zA-Z]). ...