0%

引言

为了让服务器上的别人不看我的代码,就决定对文件进行打包,然后对压缩包进行加密。

阅读全文 »

引言

通过mmap,能将file的一段内容映射到一段虚拟地址上,我们就可以在这个虚拟地址上对文件进行更改,操作系统会自动将脏数据刷回到磁盘上。

阅读全文 »

在大多数操作系统中,操作系统内核负责管理物理内存和虚拟内存。应用程序通常与虚拟内存进行交互,而不是直接与物理内存交互。这意味着,当你在程序中申请内存时(例如,使用C/C++中的mallocnew),你实际上是在申请虚拟内存空间。操作系统负责将这些虚拟内存映射到物理内存上,而且这种映射是动态的,可以发生改变。如果需要,操作系统会将不活跃的内存页交换(swap)到磁盘上。

尽管直接控制物理内存不是通常程序所做的,但在某些特定场景下,如需要确保数据处理的实时性,避免交换带来的延迟,你可能希望申请的内存常驻物理内存。在Linux系统中,可以通过以下几种方式来实现:

阅读全文 »

管道

匿名管道

如果学过 Linux 命令,那对管道肯定不陌生,Linux 管道使用竖线 | 连接多个命令,这被称为管道符。

1
$ command1 | command2
阅读全文 »

file

file能够查看文件的类型

1
2
3
4
singheart@FX504GE:~/Project/assembly$ file libadd.so 
libadd.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=4f628c334595143b6f98886acebd9f8df5a964fa, not stripped
singheart@FX504GE:~/Project/assembly$ file a.o
a.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
阅读全文 »

转载自https://blog.csdn.net/gao_zhennan/article/details/120717424#t8

0x01 浮点数在内存中的存储方式

1、什么是IEEE754标准

我们知道, 计算机内部实际上只能存储或识别二进制.

在计算机中, 我们日常所使用的文档, 图片, 数字等, 在储存时, 实际上都要以二进制的形式存放在内存或硬盘中, 内存或硬盘就好像是一个被划分为许多小格子的容器, 其中每个小格子都只能盛放0或1...

img
阅读全文 »

0x00 引言

最近看论文看到使用SIMD指令加速,从指令集到AT&T汇编再到linux系统调用一路折腾,这里就做一个小小的记录。

阅读全文 »

Motivatione

a previous single-layer NVM database N2DB[14] used the snapshot isolation from PostgreSQL[17]. Its snapshot generation process involves taking a lock and scanning a global active transaction list, which blocks concurrent transactions and is not scalable

Background

2.3 Concurrency control for NVM databases

The snapshot isolation concurrency control implementation used in traditional MVCC databases is not well suited for NVM because of two reasons. (1) The concurrency control implementations of traditional databases mainly focus on their in-memory part without discussing durability and crash consistency. They leave those to another dedicated recovery protocol, such as ARIES or write-ahead logging. The situation is different in NVM databases because a single copy of data is used for both runtime access and durability. Ensuring crash consistency should unavoidably be part of the concurrency control itself. (2) Concurrency control methods from a two-layer architecture have suboptimal performance when directly applied to a single-layer NVM database. FOEDUS[28] points out that centralized components, such as lock manager and logs in traditional concurrency control implementations, will cause performance bottlenecks in a multicore NVM database. A previous NVM database N2DB[14] adopted the concurrency control from PostgreSQL[17] to implement snapshot isolation. The concurrency control scheme from PostgreSQL uses the currently completed transactions in the system to represent a snapshot. When generating a snapshot, it has to take a lock and scan the global active transaction list. This approach blocks concurrent transactions and is not scalable. N2DB also adopted the commit log in NVM to persistently store transaction status for crash consistency. The commit log is an array-like structure and is write-shared by all threads, which limits its scalability. Zen[29] also points out that traditional concurrency control methods often need to modify the tuple metadata not only by tuple writes but also by tuple reads, which incurs expensive NVM writes.

Multi-Clock Concurrency Control