自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(128)
  • 资源 (1)
  • 收藏
  • 关注

原创 Linux操作系统的一些快捷键

Linux操作系统的一些快捷键control + Alt + T – 调出命令框(打开terminal)设置分辨率 xrandr设置次分辨率(推荐)1360x768:xrandr -s 1360x768 ;也可以选择1600x1200 或者 1680x1050(这个也挺舒服的窗口)control + shift + ‘+’ – 把字体放大control + ‘-’ – 把字体变小control + L – 清屏vi是启动某文件ls 列出当前文件夹下有什么文件vi a.c 命令行模

2021-08-28 16:44:35 352

原创 5.5socket服务端代码实现一(第二阶段)

5.5socket服务端代码实现一(第二阶段)#include <stdio.h>#include <sys/types.h> /* See NOTES */#include <sys/socket.h>//#include <linux/in.h>#include <arpa/inet.h>#include <netinet/in.h>#include <stdlib.h>//

2021-10-31 23:38:17 159

原创 5.4Linux提供的API简析(第二阶段)

5.4Linux提供的API简析(第二阶段)理论知识相关API![(https://img-blog.csdnimg.cn/c22137b980434f7c9320a25c2c1effed.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAWEZlcnJhcmk=,size_20,color_FFFFFF,t_70,g_se,x_16)...

2021-10-31 23:03:46 143

原创 5.3socket编程步骤(第二阶段)

5.3socket编程步骤(第二阶段)

2021-10-31 22:48:33 130

原创 5.2字节序(第二阶段)

5.2字节序(第二阶段)

2021-10-31 22:14:22 123

原创 5.1网络编程概述(第二阶段)

5.1网络编程概述(第二阶段)理论知识

2021-10-31 22:04:42 98

原创 线程条件控制实现线程的同步(后面有测试的方法)(第二阶段)

线程条件控制实现线程的同步(第二阶段)Linux 线程 生产者 消费者:参考文献https://blog.youkuaiyun.com/qq_695538007/article/details/42834541参考代码#include <pthread.h>#include <stdio.h>// int pthread_create(pthread_t *thread, const pthread_attr_t *attr,//

2021-10-31 21:45:30 82

原创 4.6什么情况造成死锁(第二阶段)

4.6什么情况造成死锁(第二阶段)造成死锁的原因前提条件:要有两个锁,然后当获得一把锁A的时候想获得第二把锁B,而线程B获得线程A所获得的锁,同时也想去拿线程A的锁A,这样导致线程A和线程B都想拿到对方的锁,谁都不可能往下面继续走,所以会导致死锁代码展示#include <pthread.h>#include <stdio.h>// int pthread_create(pthread_t *thread, const pthread_attr_t *attr

2021-10-31 21:14:36 80

原创 4.5线程同步之互斥量加锁解锁pthread_mutex_lock(第二阶段)

4.5线程同步之互斥量加锁解锁pthread_mutex_lock(第二阶段)代码展示#include <pthread.h>#include <stdio.h>// int pthread_create(pthread_t *thread, const pthread_attr_t *attr,// void *(*start_routine) (void *), void *arg);// int pthr

2021-10-31 21:01:01 145

原创 4.4线程同步之互斥量加锁解锁(第二阶段)

4.4线程同步之互斥量加锁解锁(第二阶段)代码展示pthread_mutex_lock();//上锁pthread_mutex_lock();//解锁要加锁解锁的APIint pthread_mutex_init(pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attr);#include <pthread.h>#include <stdio.h>// int pt

2021-10-31 20:36:16 82

原创 4.3线程共享内存空间的代码验证(第二阶段)

4.3线程共享内存空间的代码验证(第二阶段)#include <pthread.h>#include <stdio.h>// int pthread_create(pthread_t *thread, const pthread_attr_t *attr,// void *(*start_routine) (void *), void *arg);// int pthread_join(pthread_t thr

2021-10-29 23:49:28 91

原创 4.2线程创建等待及退出(第二阶段)

4.2线程创建等待及退出(第二阶段)线程 创建 pthread_cread退出 pthread_exit等待 pthread_join代码展示线程的创建#include <pthread.h>#include <stdio.h>// int pthread_create(pthread_t *thread, const pthread_attr_t *attr,// void *(*start_r

2021-10-29 23:33:38 127

原创 4.1线程概述(与进程的区别及线程的优势)(第二阶段)(峰子)

4.1线程概述(与进程的区别及线程的优势)(第二阶段)参考博文https://www.cnblogs.com/xiehongfeng100/p/4620852.html

2021-10-29 22:55:56 110

原创 3.17信号量编程实现一(第二阶段)

3.17信号量编程实现一(第二阶段)代码展示#include <stdio.h>#include <sys/types.h>#include <sys/ipc.h>#include <sys/sem.h>// int semget(key_t key, int nsems, int semflg);union semun { int val; /* Value for S

2021-10-28 22:36:09 83

原创 3.16信号量概述(第二阶段)

3.16信号量概述(第二阶段)理论知识图

2021-10-28 22:07:28 102

原创 3.15信号携带消息编程实战(第二阶段)

3.15信号携带消息编程实战(第二阶段)NiceSignal.c#include <signal.h>#include <stdio.h>// int sigaction(int signum, const struct sigaction *act,struct sigaction *oldact);//jie shou duanvoid handler (int signum, siginfo_t *info, void *context){

2021-10-27 23:42:36 95

原创 3.14信号如何携带消息(第二阶段)

3.14信号如何携带消息(第二阶段)理论知识图

2021-10-27 22:54:41 99

原创 3.13信号编程(第二阶段)

3.13信号编程(第二阶段)代码展示signalDemo1.cgcc signalDemo1.c -o pro#include <signal.h>#include <stdio.h>// typedef void (*sighandler_t)(int);// sighandler_t signal(int signum, sighandler_t handler);void handler(int signum){ printf("

2021-10-27 22:39:35 106

原创 3.12信号概述(第二阶段)

3.12信号概述(第二阶段)Linux中的信号在 Linux 中,理解信号的概念是非常重要的。这是因为,信号被用于通过 Linux 命令行所做的一些常见活动中。例如,每当你按 Ctrl+C 组合键来从命令行终结一个命令的执行,你就使用了信号。每当你使用如下命令来结束一个进程时,你就使用了信号:kill -9 [PID]所以,至少知道信号的基本原理是非常有用的。Linux中的信号在 Linux 系统(以及其他类 Unix 操作系统)中,信号被用于进程间的通信。信号是一个发送到某个进程或同一进程中的

2021-10-27 21:55:31 130

原创 3.11共享内存编程实现(第二阶段)

3.11共享内存编程实现(第二阶段)shmr.c#include <sys/ipc.h>#include <sys/shm.h>#include <stdlib.h>#include <sys/types.h>#include <stdio.h>#include <string.h>// int shmget(key_t key, size_t size, int shmflg);// vo

2021-10-27 00:03:39 124

原创 3.11共享内存概述(第二阶段)

3.11共享内存概述(第二阶段)理论知识图****

2021-10-26 23:37:55 97

原创 3.9键值生成及消息队列移除(第二阶段)

3.9键值生成及消息队列移除(第二阶段)本节共包含ftok和msgctl的用法ftok函数原型 #include <sys/types.h> #include <sys/ipc.h> key_t ftok(const char *pathname, int proj_id);msgctl函数原型 #include <sys/types.h> #include <sys/ipc.h>

2021-10-26 23:20:43 73

原创 3.8消息队列编程收发数据(第二阶段)

3.8消息队列编程收发数据(第二阶段)代码展示get#include <stdio.h>#include <sys/types.h>#include <sys/ipc.h>#include <sys/msg.h>#include <string.h>//int msgget(key_t key, int msgflg);//int msgsnd(int msqid, const void *msgp, size_t msgsz

2021-10-22 01:01:19 122

原创 3.7消息队列相关aAPI(第二阶段)

3.7消息队列的通信原理(第二阶段)理论知识图

2021-10-22 00:21:32 71

原创 3.6消息队列的通信原理(第二阶段)

3.6消息队列的通信原理(第二阶段)理论知识

2021-10-22 00:07:39 90

原创 3.5命名管道的数据通信编程实现(第二阶段)

3.5命名管道的数据通信编程实现(第二阶段)代码展示read.c#include<sys/types.h>#include<sys/stat.h>#include<stdio.h>#include<errno.h>#include <fcntl.h>//int mkfifo(const char *pathname, mode_t mode);int main(){ char buf[1024]= {0}; int

2021-10-21 23:55:01 72

原创 3.4创建命名管道(第二阶段)

3.4创建命名管道(第二阶段)进程间通信的五种方式:参考链接https://blog.youkuaiyun.com/qq_19525389/article/details/81774622?ops_request_misc=&request_id=&biz_id=102&utm_term=%E8%BF%9B%E7%A8%8B%E9%97%B4%E7%9A%84%E4%BA%94%E7%A7%8D%E9%80%9A%E4%BF%A1%E6%96%B9%E5%BC%8F&utm_medi

2021-10-21 23:28:42 83

原创 3.3管道编程实战(第二阶段)

3.3管道编程实战(第二阶段)#include <stdio.h>#include <unistd.h>#include <string.h>#include <stdlib.h>int main(){ int fd[2]; int pid; char buf[128];// int pipe(int pipefd[2]); if(pipe(fd) == -1){ printf("creat pipe failed\n");

2021-10-17 22:41:52 118

原创 3.2管道通信原理(第二阶段)

3.2管道通信原理(第二阶段)进程间通信(IPC,InterProcess Communication)是指在不同进程之间传播或交换信息。IPC的方式通常有管道(包括无名管道和命名管道)、消息队列、信号量、共享存储、Socket、Streams等。其中 Socket和Streams支持不同主机上的两个进程IPC。以Linux中的C语言编程为例。一、管道管道,通常指无名管道,是 UNIX 系统IPC最古老的形式。1、特点:它是半双工的(即数据只能在一个方向上流动),具有固定的读端和写端。它只能

2021-10-17 22:22:33 250

原创 2.13popen函数(第二阶段)

2.13popen函数(第二阶段)理论知识图片代码展示#include<stdio.h>#include<string.h>#include<stdlib.h>#include<unistd.h>//size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);int main(void){ char ret[1024] = {0}; FILE *fp; fp =

2021-10-17 21:45:08 58

原创 2.12system函数(第二阶段)

2.12system函数(第二阶段)理论知识图片代码展示#include<stdio.h>#include<string.h>#include<stdlib.h>#include<unistd.h>int main(void){ printf("this pro get system date:\n"); if(system("ps") == -1){ printf("execl failed\n"); perror("w

2021-10-17 21:31:26 93

原创 2.11exec族函数配合fork使用(第二阶段)

2.11exec族函数配合fork使用(第二阶段)理论知识图片代码展示#include<stdio.h>#include<sys/types.h>#include<unistd.h>#include <sys/stat.h>#include <fcntl.h>#include <string.h>#include <stdlib.h>int main(){ pid_t pid; int dat

2021-10-17 20:55:20 108

转载 2.10exec族函数(第二阶段)

2.10exec族函数(第二阶段)exec族函数函数的作用:我们用fork函数创建新进程后,经常会在新进程中调用exec函数去执行另外一个程序。当进程调用exec函数时,该进程被完全替换为新程序。因为调用exec函数并不创建新进程,所以前后进程的ID并没有改变。exec族函数定义:  可以通过这个网站查询:linux函数查询功能:  在调用进程内部执行一个可执行文件。可执行文件既可以是二进制文件,也可以是任何Linux下可执行的脚本文件。函数族:  exec函数族分别是:execl, exe

2021-10-17 00:15:51 180

原创 2.9父进程等待子进程退出(二)(第二阶段)

2.9父进程等待子进程退出(二)(第二阶段)理论知识图片代码展示#include<stdio.h>#include<sys/types.h>#include<unistd.h>#include<stdlib.h>#include<sys/wait.h>int main(){ pid_t pid; int cnt = 0; int status = 10; pid = fork(); if(pid &

2021-10-16 23:34:07 126

原创 2.8父进程等待子进程退出(一)(第二阶段)

2.8父进程等待子进程退出(一)(第二阶段)理论知识图片代码展示**#include<stdio.h>#include<sys/types.h>#include<unistd.h>#include<stdlib.h>#include<sys/wait.h>int main(){ pid_t pid; int cnt = 0; int status = 10; pid = fork(); if(pi

2021-10-16 23:06:53 75

原创 2.7进程退出(第二阶段)

2.7进程退出(第二阶段)理论知识代码展示#include<stdio.h>#include<sys/types.h>#include<unistd.h>#include<stdlib.h>int main(){ pid_t pid; int cnt = 0; pid = vfork(); if(pid > 0){ while(1){ printf("this is father print:%d\n"

2021-10-16 22:04:56 94

原创 2.6vfork创建进程(第二阶段)

2.6vfork创建进程(第二阶段)理论知识代码展示#include<stdio.h>#include<sys/types.h>#include<unistd.h>int main(){ pid_t pid; pid = vfork(); if(pid > 0){ while(1){ printf("this is father print:%d\n",getpid()); sleep(1); } }else i

2021-10-16 21:51:06 90

原创 2.5创建新进程实习应用场景及fork总结(第二阶段)

2.5创建新进程实习应用场景及fork总结(第二阶段)理论知识图fork创建一个子进程的一般目的fork创建一个子进程的一般目的fork编程实战代码展示#include<stdio.h>#include<sys/types.h>#include<unistd.h>int main(){ pid_t pid; int data = 10; while(1){ printf("please input a data:\n");

2021-10-16 21:33:13 103

原创 2.3创建进程函数fork的使用补充(第二阶段)

2.3创建进程函数fork的使用补充(第二阶段)代码展示#include<stdio.h>#include<sys/types.h>#include<unistd.h>int main(){ pid_t pid; pid_t pid2; pid_t retpid; pid = getpid(); printf("before fork:pid = %d\n",pid); retpid = fork(); pid2 = getp

2021-09-22 13:42:25 87

原创 2.2创建进程函数fork的使用(第二阶段)

2.2创建进程函数fork的使用(第二阶段)使用fork函数创建一个进程pid_t fork(void);fork函数调用成功,返回两次返回值为0,代表当前进程是子进程返回值非负数,代表当前进程为父进程调用失败,返回-1代码展示#include<stdio.h>#include<sys/types.h>#include<unistd.h>int main(){ pid_t pid; pid = getpid(); printf("

2021-09-22 13:33:31 96

微控制器系统综合实践_参考模板.doc

微控制器系统综合实践_参考模板.doc

2020-06-18

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除