上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 66 下一页

2022年9月1日

内核Hash表hlist

摘要: 一、Hash表简介 1. 哈希表(Hash table)又叫散列表,是根据(Key, Value) 键值对进行访问的数据结构。主要目的是提高查询效率,比如Hash表的order为5,也就是同时使用2^5个链表,理论上查询速度可以比链表快2^5倍,典型的以空间换时间。 2. 主要实现在 include 阅读全文

posted @ 2022-09-01 23:28 Hello-World3 阅读(1406) 评论(0) 推荐(0) 编辑

2022年8月31日

调度器38—cpumask

摘要: //include/linux/cpumask.h#define cpu_possible_mask ((const struct cpumask *)&__cpu_possible_mask)#define cpu_online_mask ((const struct cpumask *)&__c 阅读全文

posted @ 2022-08-31 15:51 Hello-World3 阅读(520) 评论(0) 推荐(0) 编辑

2022年7月25日

Java File I/O 操作

摘要: 一、实验Demo 1. UTF_8格式读写文件节点 import java.io.*; import static java.nio.charset.StandardCharsets.UTF_8; public class FileIo { static final String TAG = "Fi 阅读全文

posted @ 2022-07-25 16:22 Hello-World3 阅读(53) 评论(0) 推荐(0) 编辑

2022年7月23日

Linux内核机制—percpu

摘要: 一、per-cpu变量简介 在多处理器系统中,每处理器变量为每个cpu都生成一个变量的副本,每个处理器使用自己的副本,从而避免了处理器之间的互斥和同步,提高了程序的执行速度。每处理器变量分为静态per-cpu变量和动态per-cpu变量。 二、静态per-cpu变量 1. 静态per-cpu变量使用 阅读全文

posted @ 2022-07-23 21:00 Hello-World3 阅读(1022) 评论(0) 推荐(0) 编辑

调度器30—调度相关结构体—struct sched_entity

摘要: 一、struct sched_entity 1. se->sum_exec_runtime 表示实际running的时间,不包括runnable时间。 (1) sum_exec_runtime 的更新逻辑 void set_next_entity(struct cfs_rq *cfs_rq, str 阅读全文

posted @ 2022-07-23 20:08 Hello-World3 阅读(397) 评论(0) 推荐(0) 编辑

2022年7月19日

HIDL学习笔记_4——使用总结

摘要: 1. 在修改.hal文件时需要同时更新current.txt文件中的hash,触发hash更新的方法如下 //若对下面文件产生hash: source/vendor/mom/hardware/interface/performance/1.0/IPerformance.hal package ven 阅读全文

posted @ 2022-07-19 14:25 Hello-World3 阅读(315) 评论(0) 推荐(0) 编辑

2022年7月11日

kptr_restrict 内核文件简介

摘要: 一、简介 系统为了保护内核符号地址不被泄露, 而用的一种保护手段, 从而使除 root 用户外的普通用户不能直接查看符号地址。原因在于内核文件 kallsyms.c 中的显示符号地址命令中做了如下限制: seq_printf(m, "%pK %c %s\n", (void *)iter->value 阅读全文

posted @ 2022-07-11 21:28 Hello-World3 阅读(1294) 评论(0) 推荐(0) 编辑

2022年7月10日

Binder学习笔记1—Service示例分析

摘要: 一、示例一:SystemSuspend对binder使用 1. 示例代码 //vnd/system/hardware/interfaces/suspend/1.0/default/main.cpp #include <binder/IPCThreadState.h> #include <binder 阅读全文

posted @ 2022-07-10 21:31 Hello-World3 阅读(1147) 评论(0) 推荐(0) 编辑

C++经典案例

摘要: 1. per-thread的单例模式 //单例子模式,per-thread的单例模式 IPCThreadState* IPCThreadState::self() //IPCThreadState.cpp { if (gHaveTLS.load(std::memory_order_acquire)) 阅读全文

posted @ 2022-07-10 16:08 Hello-World3 阅读(613) 评论(0) 推荐(0) 编辑

2022年7月9日

Linux内核中各种鉴权

摘要: 一、编译阶段 1. BUILD_BUG 系列 主要定义在 include/linux/build_bug.h 文件中,若编译期发现不合法就报错并中止编译。 (1) BUILD_BUG_ON(condition) #define BUILD_BUG_ON(condition) BUILD_BUG_ON 阅读全文

posted @ 2022-07-09 17:19 Hello-World3 阅读(811) 评论(0) 推荐(0) 编辑

上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 66 下一页

导航