
Linux
Linux
Lee_01
coder
展开
-
Linux查看CPU、内存、磁盘运行情况
【代码】Linux查看CPU、内存、磁盘运行情况。原创 2024-03-23 00:38:05 · 193 阅读 · 0 评论 -
Linux Bash快捷键
Ctrl + A Go to the beginning of the line you are currently typing onCtrl + E Go to the end of the line you are currently typing onCtrl + L Clears the Screen, similar to the clear commandCtrl + U Clears the line before the cursor position. If you are原创 2021-07-11 16:07:13 · 149 阅读 · 0 评论 -
vim使用笔记
工作模式~/.vimrc 配置文件set numberset mouse=aset autoindent"change tab to 4 space"set expandtabset softtabstop=4set textwidth=80set wrapset linebreakset wrapmargin=2set spell spelllang=en_us"prompt when current file is changed by another progr原创 2020-08-08 22:50:09 · 194 阅读 · 0 评论 -
Linux安装(虚拟机和双系统两种方法)
一、VMware虚拟机1.下载并安装VMware:①https://my.vmware.com/cn/web/vmware/free#desktop_end_user_computing/vmware_workstation_player/15_0②下载Ubuntu镜像文件:https://www.ubuntu.com/download/desktop2.安装Linux①点击VM...原创 2018-10-16 16:16:42 · 10263 阅读 · 3 评论 -
CentOS下解决视频解码问题(opencv)
问题:安装了ffmpeg后,opencv中将视频转换为图片时还是报错一、安装ffmpeg先卸载已安装的ffmpeg 安装yasm:yum install yasm 下载ffmpeg:http://ffmpeg.org/ 解压:tar -xjvf ffmpeg-3.3.1.tar.bz2 配置ffmpeg,进入ffmpeg-3.3.1所在目录,依次执行以下命令:cd ffmp...原创 2019-04-09 00:04:54 · 719 阅读 · 0 评论 -
for循环中的fork()
以下代码共输出多少个’-’?答:8个,不是6个解释:fork()系统调用是Unix下以自身进程创建子进程的系统调用,一次调用,两次返回,如果返回是0,则是子进程,如果返回值>0,则是父进程(返回值是子进程的pid)。在fork()的调用处,整个父进程空间会原模原样地复制到子进程中,包括指令,变量值,程序调用栈,环境变量,缓冲区,等等。先看改进代码,观察进程树:...转载 2019-04-09 00:10:37 · 7403 阅读 · 2 评论 -
Linux进程管理
一、进程1.概念进程是正在内存中运行的程序 ps au可以列出操作系统中正在运行的进程2.fork函数#include<unistd.h>// 功能:创建进程// 返回值:成功时返回进程ID,失败时返回-1pid_t fork();两个进程都将执行fork函数返回后的语句。因为通过同一个进程、复制相同的内存空间,所以之后的程序流要通过fork函数的返回值加以...原创 2019-04-09 00:21:08 · 165 阅读 · 0 评论 -
有关进程同步与互斥的经典问题
1生产者消费者问题1.1使用二元信号量解决无限缓冲区的生产者消费者问题//使用二元信号量解决无限缓冲区的生产者消费者问题int count = 0; //count为缓冲区中的数据项个数BinSem s = 1, delay = 0; //s为二元信号量,控制生产者和消费者进入临界区; //delay为二元信号量,处...原创 2019-04-09 00:09:50 · 2403 阅读 · 3 评论 -
实现进程互斥的方法
1软件方法:1.1单标志法/* PROCESS 0 */while(turn != 0);/* critical section */turn = 1;/* PROCESS 1 */while(turn != 1);/* critical section */turn = 0;特点:1)进入临界区之前先检查turn,如果等于进程号,就可以进入临界区,否则循环等待,因此...原创 2019-04-09 00:09:21 · 4660 阅读 · 4 评论