摘要: 使用spinlock的线程会忙等待,不断的检测锁是否可以用,适用条件,锁的内容比较少的时候 使用mutex的线程会引起线程的切换,适用条件,锁的内容比较多的时候 等待的代价小于线程切换的代价的时候可以考虑使用自旋锁, 阅读全文
posted @ 2024-02-17 20:02 wangshaodong 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 关于中文字符的各种编码,初等数学的几何图形等等, https://www.haomeili.net/Code/DetailCodes?wd=%E8%B7%AF%E5%BE%84 国内科研及新闻 成果网站 https://news.sciencenet.cn/sbhtmlnews/2022/11/37 阅读全文
posted @ 2023-03-21 09:40 wangshaodong 阅读(58) 评论(0) 推荐(0) 编辑
摘要: | 变量 | 说明 | | : | : | | $n | n是一个参数,从1开始表示参数的位置,例如:$1表示第一个参数,$2表示第二个参数 | | $# | 命令行参数的个数 | | $0 | 当前shell脚本的名称 | | $? | 前一个命令或者是函数的返回状态码,0代表执行成功,非0即失败 阅读全文
posted @ 2023-03-15 16:54 wangshaodong 阅读(18) 评论(0) 推荐(0) 编辑
摘要: # 举例子,修改cd的默认路径 function cd() { if [ $# == 0 ]; then builtin cd ~/work else builtin cd $* fi } ref如下,一下博客中 还有其他方法,只是选了其中一个,try and it works https://ww 阅读全文
posted @ 2023-03-09 09:07 wangshaodong 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 修改 buildroot的配置选项,增删软件包 cd builroot make xxx_defconfig # xxx_defconfig 就在 buildroot 目录下中对应的板子文件 make menuconfig # 字符图形化界面修改配置 make savedefconfig BR2_D 阅读全文
posted @ 2023-03-09 08:57 wangshaodong 阅读(767) 评论(0) 推荐(0) 编辑
摘要: 编辑要调试的脚本compile.sh的开头,加入 set +xv # 这个命令会把shell脚本的执行过程和执行的相应语句都打印出来,感觉可以类比 gdb中的逐步调试 然后重定向脚本的运行结果到一个日志文件,像这样,然后执行 ./compile.sh 2>&1 | tee build.output. 阅读全文
posted @ 2023-03-09 08:29 wangshaodong 阅读(60) 评论(0) 推荐(0) 编辑
摘要: 复制可执行文件的路径 shift + 鼠标右键,选择复制文件地址 当前路径打开cmd 或者powershell ##方法1: shift + 鼠标右键,选择在此处打开powershell ##方法2: 在资源管理器上方鼠标选中全部路径,然后输入cmd 阅读全文
posted @ 2023-03-09 08:19 wangshaodong 阅读(27) 评论(0) 推荐(0) 编辑
摘要: # clean the DNScache ipconfig/flushdns #display result ipconfig /displaydns 阅读全文
posted @ 2023-03-07 11:47 wangshaodong 阅读(12) 评论(0) 推荐(0) 编辑
摘要: # 注意 是 C语言代码,不是C++ void func(void) { const int buf_len = 64; char buffer[buf_len] = { 0 }; } $$cat -n fun.c 1 void func(void) 2 { 3 const int buf_len 阅读全文
posted @ 2023-03-04 20:55 wangshaodong 阅读(21) 评论(0) 推荐(0) 编辑
摘要: $ git remote -v origin git@github.com:AAAAAA/BBBBB.git (fetch) origin git@github.com:AAAAAA/BBBBB.git (push) $ git push origin HEAD:refs/heads/dev-xxx 阅读全文
posted @ 2023-03-04 19:57 wangshaodong 阅读(8) 评论(0) 推荐(0) 编辑