首页
学习
活动
专区
工具
TVP
发布

Miigon's Blog

专栏作者
37
文章
31679
阅读量
12
订阅数
[随笔]文件系统上存储哈希对象:哈希算法以及目录结构对性能的影响
原贴:https://0xffff.one/d/1395-wen-jian-xi-tong-zuo-wei-huan-cun
Miigon
2023-03-31
8070
随笔:Golang 循环变量引用问题以及官方语义修复
这篇文章谈一个已经在 Golang 中存在多年的,几乎每一个新手都要被坑一遍的设计:引用捕获了循环变量,且逃逸出循环迭代范围而造成的逻辑错误。
Miigon
2023-03-16
1.2K0
Linux 是否有 zombie thread?源码探究分析
系统编程课上遇到的一个问题:Linux下,如果一个 pthread_create 创建的线程没有被 pthread_join 回收,是否会和僵尸进程一样,产生“僵尸线程”?
Miigon
2022-11-25
1.6K0
MySQL Prepare后语句查询性能降低 源码bug排查分析
源自于业务上遇到的一个先将某个语句Prepare再Execute查询效率很低的问题,而将查询中的参数直接嵌入到SQL语句内并以文本形式执行,则执行反而变得很快。
Miigon
2022-11-25
1.4K0
[StackOverflow] C++ gRPC 异步 API 实例与优势
转自 我的一个 StackOverflow 回答。因为答案比较长,而且感觉比较有意义,就翻译成了中文发了出来。 原问题: 我正在用 gRPC 构建一个要求高吞吐量的服务。但是我现在用 C++ 同步式 gRPC 编写的程序的吞吐量并不高。 我已经读过了 gRPC 文档,但是我并没有找到对于同步/异步 API 的区别的清晰解释。我只知道异步 API 可以控制完成队列(completion queue),而对于同步 API 来说是不可视的。 我的理解是同步 gRPC 会发送消息到 TCP 层,然后等待收到 “ack”,因此下个消息会被阻塞,而异步 API 会异步地发送消息,而不需要后面的消息等待前面的消息。
Miigon
2022-10-27
1.2K0
记一次 C++ 核心语言标准中一个 issue 的发现和提交经历
上面的代码,无论是在 gcc/clang 还是 g++/clang++ 上,编译都是不能通过的,报错如下:
Miigon
2022-10-27
4820
[mit6.033] 第一部分 LEC 1-6 Operating Systems 笔记
命名的 scheme 体现了我们希望系统通过命名来得到什么功能。(addressing, indirection, etc)
Miigon
2022-10-27
4620
[mit6.033] 第二部分 LEC 7-12 Networking 笔记
这一部分 Lecture 讲的内容,与计算机网络有一定重合,这里笔记偏向于在系统设计中需要考虑的概念,而至于具体的协议、网络通信的具体细节等,即使在 lecture 视频中提到了,也不会记录到笔记中。这一部分细节可以通过计算机网络课程学习。
Miigon
2022-10-27
2630
[SZU] 数据库内核课程 PostgreSQL 12.5 源码安装避坑 guide
Linux/Mac 用户可直接编译,Windows 用户自行搜索 wsl 教程配置后,剩余流程同 Linux 用户。
Miigon
2022-10-27
1.2K0
[mit6.s081] 笔记 Lab1: Unix utilities | Unix 实用工具
This lab will familiarize you with xv6 and its system calls.
Miigon
2022-10-27
1.1K0
[mit6.s081] 笔记 Lab10: Mmap | 文件内存映射
实现 *nix 系统调用 mmap 的简单版:支持将文件映射到一片用户虚拟内存区域内,并且支持将对其的修改写回磁盘。
Miigon
2022-10-27
1.3K0
[mit6.s081] 笔记 Lab11: Networking | 网络
熟悉系统驱动与外围设备的交互、内存映射寄存器与 DMA 数据传输,实现与 E1000 网卡交互的核心方法:transmit 与 recv。
Miigon
2022-10-27
4710
[mit6.s081] 笔记 Lab2: System calls | 系统调用
In this lab you will add some new system calls to xv6, which will help you understand how they work and will expose you to some of the internals of the xv6 kernel. You will add more system calls in later labs.
Miigon
2022-10-27
9040
[mit6.s081] 笔记 Lab3: Page tables | 页表
In this lab you will explore page tables and modify them to simplify the functions that copy data from user space to kernel space.
Miigon
2022-10-27
1.5K0
[mit6.s081] 笔记 Lab4: Traps | 中断陷阱
This lab explores how system calls are implemented using traps. You will first do a warm-up exercises with stacks and then you will implement an example of user-level trap handling.
Miigon
2022-10-27
5660
[mit6.s081] 笔记 Lab5: Lazy Page Allocation | 内存页懒分配
实现一个内存页懒分配机制,在调用 sbrk() 的时候,不立即分配内存,而是只作记录。在访问到这一部分内存的时候才进行实际的物理内存分配。
Miigon
2022-10-27
7200
[mit6.s081] 笔记 Lab6: Copy-on-write fork | fork 懒拷贝
COW fork() creates just a pagetable for the child, with PTEs for user memory pointing to the parent’s physical pages. COW fork() marks all the user PTEs in both parent and child as not writable. When either process tries to write one of these COW pages, the CPU will force a page fault. The kernel page-fault handler detects this case, allocates a page of physical memory for the faulting process, copies the original page into the new page, and modifies the relevant PTE in the faulting process to refer to the new page, this time with the PTE marked writeable. When the page fault handler returns, the user process will be able to write its copy of the page.
Miigon
2022-10-27
7160
[mit6.s081] 笔记 Lab7: Multithreading | 多线程
This lab will familiarize you with multithreading. You will implement switching between threads in a user-level threads package, use multiple threads to speed up a program, and implement a barrier.
Miigon
2022-10-27
9062
[mit6.s081] 笔记 Lab8: Locks | 锁优化
通过拆分 kmem 中的空闲内存链表,降低 kalloc 实现中的 kmem 锁竞争。
Miigon
2022-10-27
8170
[mit6.s081] 笔记 Lab9: File System | 文件系统
与 FAT 文件系统类似,xv6 文件系统中的每一个 inode 结构体中,采用了混合索引的方式记录数据的所在具体盘块号。每个文件所占用的前 12 个盘块的盘块号是直接记录在 inode 中的(每个盘块 1024 字节),所以对于任何文件的前 12 KB 数据,都可以通过访问 inode 直接得到盘块号。这一部分称为直接记录盘块。
Miigon
2022-10-27
8030
点击加载更多
社区活动
RAG七天入门训练营
鹅厂大牛手把手带你上手实战
Python精品学习库
代码在线跑,知识轻松学
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档