iterm2配置zsh和常用插件
直接看效果图


map的读写删除都不是原子操作,因此需要控制并发访问,而Go的原生map不支持并发读写;Go在1.9的版本中新增了sync.Map的数据结构,两个map实现分离。
不会引发扩容的操作(查,改)使用read map,可能引发扩容操作(新增)使用 dirty map。
读写 read 并不需要加锁,而读或写 dirty 则需要加锁。
适合读多 append 少的场景,其实是读写和追加分离。
slice 切片,也可以理解为动态数组。与数组相比切片的长度是不固定的,可以追加元素,在追加时可能使切片的容量增大。
每次都被 defer,panic和recover 坑的死去活来,今天抽出时间来整理一下。
HashMap 有两种主流实现方式:开放寻址法和拉链法。Go 的 map 采用拉链法实现。
Go map 的核心结构包含:
基本数据结构:桶数组 + 桶内 key-value 数组 + 溢出桶链表
(软件包安装的单元)
The expectation is that /lib/systemd/system is a directory that should only contain systemd unit files which were put there by the package manager (YUM/DNF/RPM/APT/etc).
(系统管理员安装的单元, 优先级更高)
Files in /etc/systemd/system are manually placed here by the operator of the system for ad-hoc software installations that are not in the form of a package. This would include tarball type software installations or home grown scripts.