上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 71 下一页

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 阅读(1906) 评论(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 阅读(683) 评论(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 阅读(76) 评论(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 阅读(2172) 评论(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 阅读(396) 评论(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 阅读(1761) 评论(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 阅读(1359) 评论(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 阅读(654) 评论(0) 推荐(0)

2022年7月5日

C++ std::ofstream 和 std::ifstream 和 文件操作

摘要: 1. 简介 C++中对文件进行读写的。 2. 使用Demo #include <iostream> #include <fstream> #include <string> #include <string.h> using namespace std; static constexpr char 阅读全文

posted @ 2022-07-05 23:39 Hello-World3 阅读(2499) 评论(0) 推荐(0)

2022年7月4日

C++匿名函数-Lambda表达式

摘要: 一、匿名函数简介 1. 为什么存在匿名函数 使用 STL 时,往往会大量用到函数对象,为此要编写很多函数对象类。有的函数对象类只用来定义了一个对象,而且这个对象也只使用了一次,编写这样的函数对象类就有点浪费。 而且,定义函数对象类的地方和使用函数对象的地方可能相隔较远,看到函数对象,想要查看其 op 阅读全文

posted @ 2022-07-04 23:27 Hello-World3 阅读(971) 评论(0) 推荐(0)

上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 71 下一页

导航