上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 66 下一页

2023年5月3日

C++中的构造析构函数—2—虚析构函数

摘要: 1. 构造函数不能定义为虚函数,每个对象的虚函数表指针是在构造函数中初始化的,因为构造函数没执行完,所以虚函数表指针还没初始化好。而析构函数可以定义为虚函数,也必须要定义为虚函数,否则在析构上无法体现出多态,导致子类的析构函数不会被调用,可能导致内存泄漏等风险。 2. 实验: #include <i 阅读全文

posted @ 2023-05-03 22:43 Hello-World3 阅读(38) 评论(0) 推荐(0) 编辑

2023年4月27日

RCU-5——RCU案例汇总

摘要: 基于 Linux-5.10 一、经典(可抢占)RCU 1. 例子-RCU链表 假设链表节点和头结点如下: typedef struct { struct list_head link; struct rcu_head rcu; //used for call_rcu() int key; int v 阅读全文

posted @ 2023-04-27 21:10 Hello-World3 阅读(144) 评论(0) 推荐(0) 编辑

RCU-4——不可抢占RCU代码分析

摘要: 基于 Linux-5.10 一、不可抢占RCU 1. 不可抢占RCU不允许进程在读端临界区被其它进程抢占,使用函数 rcu_read_lock_sched()/rcu_read_unlock_sched() 标记读临界区。前者禁止内核抢占,后者开启内核抢占。 static inline void r 阅读全文

posted @ 2023-04-27 21:04 Hello-World3 阅读(149) 评论(0) 推荐(0) 编辑

RCU-3——经典(可抢占)RCU代码分析

摘要: 基于 Linux-5.10 一、相关数据结构 1. struct rcu_state rcu_state 用于描述RCU全局状态。 struct rcu_state { struct rcu_node node[NUM_RCU_NODES]; /* Hierarchy. */ struct rcu_ 阅读全文

posted @ 2023-04-27 20:58 Hello-World3 阅读(565) 评论(0) 推荐(0) 编辑

RCU-2——RCU初探

摘要: 一、RCU简介 RCU(Read-Copy-Update)的意思是读-复制-更新,是根据原理命名的。写者修改对象的逻辑是: 首先复制一个副本,然后更新这个副本,最后使用新的对象替换旧的对象。在写者执行复制更新的时候读者可以读数据。 写者删除对象,必须要等到所有读者结束访问,才能执行销毁操作。RCU的 阅读全文

posted @ 2023-04-27 20:37 Hello-World3 阅读(415) 评论(0) 推荐(0) 编辑

2023年4月20日

RT-Mutex-3——实现分析-pi-futex与rt-mutex

摘要: 一、rt-mutex 的原理 PI-futex是通过rt mutex来实现的,因此我们这里简单的聊一聊内核的这个PI-aware mutex。 从rt mutex的视角看任务: rt_mutex_waiter 用来抽象一个阻塞在 rt mutex 的任务:task 成员指向这个任务,lock 成员指 阅读全文

posted @ 2023-04-20 22:27 Hello-World3 阅读(346) 评论(0) 推荐(0) 编辑

2023年4月15日

Android中GC—初探-1—触发时机和条件

摘要: 一、GC 简介 Java 对象的创建由 Allocator 负责,回收由 Collector 负责。从 Android O 开始,对于前台应用默认的 GC Collector 是 CC(Concurrent Copying) Collector,与之相匹配的 Allocator 则是 Region- 阅读全文

posted @ 2023-04-15 12:20 Hello-World3 阅读(733) 评论(0) 推荐(0) 编辑

2023年3月24日

Makefile笔记(5)——经典案例

摘要: 1. Makefile中使用shell脚本 msm-5.10/tools/testing/selftests/futex$ cat Makefile # SPDX-License-Identifier: GPL-2.0 SUBDIRS := functional TEST_PROGS := run. 阅读全文

posted @ 2023-03-24 00:01 Hello-World3 阅读(39) 评论(0) 推荐(0) 编辑

2023年3月20日

调度器47—上下文切换

摘要: 1. current上下文切换时刻 //调用路径 __schedule //整个切换都是关local irq的 context_switch //函数最后才调用它 switch_to cpu_switch_to //cpu_switch_to 实现 //arch/arm64/include/asm/ 阅读全文

posted @ 2023-03-20 11:00 Hello-World3 阅读(111) 评论(0) 推荐(0) 编辑

2023年3月6日

Cgroup学习笔记4—相关DEBUG

摘要: 一、相关DEBUG接口 1. cat /proc/mounts | grep cgroup 可以查看每个子系统挂载位置等信息 # cat /proc/mounts | grep cgroup none /dev/blkio cgroup rw,nosuid,nodev,noexec,relatime 阅读全文

posted @ 2023-03-06 11:29 Hello-World3 阅读(175) 评论(0) 推荐(0) 编辑

上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 66 下一页

导航