???????????£????????
???????????? ???????[ 2013/12/24 13:59:00 ] ????????????? ??? ???????
????????????????????к???????????????ū?????????????浽????????????????????????漰?????????????????????????????????????????????е????????????????
??1????CPU?μ?????
????г?????CPU???????????????????????????ж??????????????????????????????????ε?????Щ??????д????????????????????Щ?????????????????
1???????????????
2??????FIFO????
3????????????????
?????????CPU?????????л????Щ????????????????????????楨?????????socket???????????????е????????????????????Щ?????С?????????????????????
??????????????linux??????????????????????task_struct????????????????????????????????????task_struct??linux 0.11????????????Щ?????
struct task_struct {
/* these are hardcoded - don't touch */
long state; /* -1 unrunnable?? 0 runnable?? >0 stopped */
long counter;
long priority;
long signal;
struct sigaction sigaction[32];
long blocked; /* bitmap of masked signals */
/* various fields */
int exit_code;
unsigned long start_code??end_code??end_data??brk??start_stack;
long pid??father??pgrp??session??leader;
unsigned short uid??euid??suid;
unsigned short gid??egid??sgid;
long alarm;
long utime??stime??cutime??cstime??start_time;
unsigned short used_math;
/* file system info */
int tty; /* -1 if no tty?? so it must be signed */
unsigned short umask;
struct m_inode * pwd;
struct m_inode * root;
struct m_inode * executable;
unsigned long close_on_exec;
struct file * filp[NR_OPEN];
/* ldt for this task 0 - zero 1 - cs 2 - ds&ss */
struct desc_struct ldt[3];
/* tss for this task */
struct tss_struct tss;
};
????task?????????pid?????????????????????pid???д????????????????????????????????塣
????????????????????????task_struct?????????????壬??????????thread????????????????????thread????????????????????????????????????????????????????鷳?????????????????Щ????????????????????????????????
???????????????????????????????????????????????з????????Щ???????
1?????????????
2????????????->??????->???????
3??д???????->??????->д??????
???д????????????????????
#include <unistd.h>
#include <stdio.h>
int value = 10;
int main(int argc?? char* argv[])
{
int pid = fork();
if(!pid){
Value = 12;
return 0;
}
printf("value = %d
"?? value);
return 1;
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11