⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 procmodel.c

📁 Solaris下进程编程源码,sun公司培训用例
💻 C
字号:
#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <pthread.h>void* thr_fn1(void*);void* thr_fn2(void*);int main(){        pthread_t tid;        if (pthread_create(&tid, NULL, thr_fn1, NULL) != 0)                exit(-1);        if (pthread_create(&tid, NULL, thr_fn2, NULL) != 0)                exit(-1);	        while (1) {                sleep(1);                printf("Thread %d is running...\n", pthread_self());        }}void* thr_fn1(void* args){        while (1) {                sleep(2);                printf("Thread %d is running...\n", pthread_self());        }}void* thr_fn2(void* args){        while (1) {                sleep(3);                printf("Thread %d is running...\n", pthread_self());        }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -