十七

Archives

2022 / 03

class Solution {public: int shipWithinDays(vector<int>& weights, int days) { int l=*max_element(weights.begin(),weights.end());
class Solution {public: int networkDelayTime(vector<vector<int>>& times, int n, int k) { int inf=INT_MAX/2; vector&lt

2022-03-07

1.进程创建/* 一般情况下,main函数所在的线程我们称之为主线程(main线程),其余创建的线程 称之为子线程。 程序中默认只有一个进程,fork()函数调用,2进行 程序中默认只有一个线程,pthread_create()函数调用,2个线程。 #include &

2022-03-07

进程间通信1. 无名管道/* #include <unistd.h> int pipe(int pipefd[2]); 功能:创建一个匿名管道,用来进程间通信。 参数:int pipefd[2] 这个数组是一个传出参数。 pi

2022-03-07

一、多进程开发fork函数/* #include <sys/types.h> #include <unistd.h> pid_t fork(void); 函数的作用:用于创建子进程。 返回值: fork()的