当前位置: 首页 > news >正文

网站主要盈利模式seo外链软件

网站主要盈利模式,seo外链软件,上海社会建设网站,自助建站是什么意思一、进程的状态 1.1 进程的状态 1.1.1 并行与并发 • 并行: 多个进程在多个CPU下分别,同时进行运行 • 并发: 多个进程在一个CPU下采用进程切换的方式,在一个时间片内,让多个进程都得以推进 1.1.2 时间片的概念 LInux/windows这些民用级别…

一、进程的状态

1.1 进程的状态

在这里插入图片描述

1.1.1 并行与并发

并行: 多个进程在多个CPU下分别,同时进行运行
并发: 多个进程在一个CPU下采用进程切换的方式,在一个时间片内,让多个进程都得以推进

1.1.2 时间片的概念

LInux/windows这些民用级别的操作系统都是分时操作系统,根据时间片进行调度轮转的,与之相对的是实时操作系统

1.1.3 进程具有独立性

上一篇博客中已经讲过。

1.1.4 认识运行、阻塞与挂起

• 在CPU中有一个runqueue,操作系统会根据FIFO获取进程并将进程基于时间片进行调度轮转,因而只要进程在runqueue中就已经是运行态
• 操作系统会对设备进行管理,因此有了struct device 对设备进行先描述后组织。当进程执行到某一位置时,可能会调用外部设备(如键盘),这时就会将进程链入waitqueue中,这一状态称为阻塞态
• 当内存内存资源严重不足时,操作系统会将等待队列的进程中的数据换出到磁盘中,而当用户完成指定操作后又会将数据换入到内存中,磁盘中支持此操作有专门的分区(swap分区)。这也就是阻塞挂起状态
• 对于阻塞挂起状态本质就是以时间换空间的做法,现在大部分的公司都会禁掉该操作。

1.2 Linux的进程状态

在这里插入图片描述

下面这段代码是Linux0.11版本中的状态源码:

/*
* The task state array is a strange "bitmap" of
* reasons to sleep. Thus "running" is zero, and
* you can test for combinations of others with
* simple bit tests.
*/
static const char * const task_state_array[] = {
"R (running)", /* 0 */
"S (sleeping)", /* 1 */
"D (disk sleep)", /* 2 */
"T (stopped)", /* 4 */
"t (tracing stop)", /* 8 */
"X (dead)", /* 16 */
"Z (zombie)", /* 32 */
};

R :运行状态
S :浅度休眠状态,可以被kill
D:磁盘休眠状态,不可被kill

D状态存在的意义在于,当内存资源严重不足时,操作系统可能会将正在向磁盘传输数据的进程杀掉以维持自身安全,但是数据是不可恢复的,一旦进程被终止,我们并不知道传输数据这个操作是否成功,因此引入了D状态,使得操作系统不能杀死处于D状态的程序。

T:暂停状态,通常是进程做了非法但不致命的操作,只能用kill -9终止
t :追踪暂停状态,常见调试时打断点
X:死亡状态
Z:僵尸状态,用于维护自己的task_struct,方便为了父进程读取进程退出信息

理解X状态和Z状态
• 进程创建的目的自然是为了完成用户的任务。那么进程就需要知道这个任务完成的情况,这样就需要将执行的进程的执行结果返回给父进程/操作系统。我们可以使用$?来查看最近的一个进程的退出信息。
•进程=内核数据结构(struct task_struct)+代码和数据。进程在退出时,首先立即释放的就是该进程的代码和数据。但是进程的退出信息需要返回给父进程/操作系统,而退出信息保存在task_struct中。因此进程的退出信息必须要被操作系统维护起来,方便用户的获取。*这时的进程状态就是Z状态。 *当进程的退出信息被父进程/操作系统获取之后,进程就销毁了,这时的进程就是X状态。


知道了当子进程退出,父进程没有退出时,子进程就是僵尸进程;那么当父进程退出,子进程没有退出时是什么情况呢?
这就是孤儿进程,子进程会被系统领养,当它退出时,系统会对这个子进程进行处理回收。

二、进程的优先级

2.1 概念

优先级本质上就是对某种资源获取的先后顺序,这种资源往往是稀缺的。在进程层次来看,优先级竞争的是CPU资源。

2.2 Linux进程优先级

我们可以使用ps -l 查到优先级信息:

[caryon@VM-24-10-centos ~]$ ps -l
F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
0 S  1001  6876  6875  0  80   0 - 29247 do_wai pts/0    00:00:00 bash
0 R  1001  6975  6876  0  80   0 - 38332 -      pts/0    00:00:00 ps

在task_struct中有优先级属性,它是通过几个int类型的变量来表示优先级的。优先级的数字越小,对应进程的优先级越高。
上图中的PRI和NI两个属性影响进程的优先级,其中PRI是默认优先级(80),NI是优先级的修正数据([-20,20))

优先级如何进行调整呢?
使用top指令,输入r,然后根据提示进行调整。

但是一般情况下我们不对优先级进行调整,即使调整也要保证nice值有一定的范围,这是因为我们的操作系统是分时操作系统,对进程的调度要尽量公平。

UID
上图中我们还看到了UID这一属性,UID全称User Identify,是用以标记进程是谁启动的。在文件显示时,我们可以使用ll -n来以数字显示文件的相关属性,这个数字也是UID。

[caryon@VM-24-10-centos linux]$ ll -n
total 2452
drwxrwxr-x 2 1001 1001   4096 Sep 16 11:39 test

前面我们知道文件有自己的权限,即拥有者、所属组;我们还知道Linux下一切皆文件,所有的操作都是进程操作,因此进程会记录是谁启动的这个进程。通过UID与文件的拥有者、所属组进行对比实现了对权限的控制。


文章转载自:
http://dinncocrackable.tqpr.cn
http://dinncoentrancing.tqpr.cn
http://dinncoskiplane.tqpr.cn
http://dinncomerdeka.tqpr.cn
http://dinncocombinatory.tqpr.cn
http://dinncocunt.tqpr.cn
http://dinncovitellogenic.tqpr.cn
http://dinncoreefer.tqpr.cn
http://dinncoapproved.tqpr.cn
http://dinncograndiloquent.tqpr.cn
http://dinncozamindar.tqpr.cn
http://dinncoditcher.tqpr.cn
http://dinncocorral.tqpr.cn
http://dinncofatah.tqpr.cn
http://dinncovaseline.tqpr.cn
http://dinncovirginal.tqpr.cn
http://dinncotribunician.tqpr.cn
http://dinncocardfile.tqpr.cn
http://dinncophototheodolite.tqpr.cn
http://dinncoresection.tqpr.cn
http://dinncobathing.tqpr.cn
http://dinncosubclinical.tqpr.cn
http://dinncogoluptious.tqpr.cn
http://dinncoinerrant.tqpr.cn
http://dinncosunspot.tqpr.cn
http://dinncovahana.tqpr.cn
http://dinncocolumnist.tqpr.cn
http://dinncoreformative.tqpr.cn
http://dinncopractically.tqpr.cn
http://dinncoaries.tqpr.cn
http://dinncokimbundu.tqpr.cn
http://dinncoeudemonics.tqpr.cn
http://dinncopetrochemistry.tqpr.cn
http://dinncobinal.tqpr.cn
http://dinncotam.tqpr.cn
http://dinncoenlightened.tqpr.cn
http://dinncomonocrat.tqpr.cn
http://dinncosealless.tqpr.cn
http://dinncoperseverance.tqpr.cn
http://dinncocerebralism.tqpr.cn
http://dinncoenarthroses.tqpr.cn
http://dinncounscriptural.tqpr.cn
http://dinncoantifibrinolysin.tqpr.cn
http://dinncokanchenjunga.tqpr.cn
http://dinncoskiey.tqpr.cn
http://dinncopropulsor.tqpr.cn
http://dinncocivilizable.tqpr.cn
http://dinncohyalinize.tqpr.cn
http://dinncotolan.tqpr.cn
http://dinncoporteress.tqpr.cn
http://dinncoworn.tqpr.cn
http://dinncopamphrey.tqpr.cn
http://dinncomammon.tqpr.cn
http://dinncocossette.tqpr.cn
http://dinncoblackbody.tqpr.cn
http://dinncoaneurysm.tqpr.cn
http://dinncoovercurtain.tqpr.cn
http://dinncoseventeeth.tqpr.cn
http://dinncoshijiazhuang.tqpr.cn
http://dinncocartographer.tqpr.cn
http://dinncobailie.tqpr.cn
http://dinncononvanishing.tqpr.cn
http://dinncoparabomb.tqpr.cn
http://dinncopinnatipartite.tqpr.cn
http://dinncoapostleship.tqpr.cn
http://dinncotinkler.tqpr.cn
http://dinncodefeature.tqpr.cn
http://dinncocaliculate.tqpr.cn
http://dinncocockshot.tqpr.cn
http://dinnconoctambulism.tqpr.cn
http://dinncoabortion.tqpr.cn
http://dinncounapproachable.tqpr.cn
http://dinncohereditarily.tqpr.cn
http://dinncodownswing.tqpr.cn
http://dinncoswedenborgian.tqpr.cn
http://dinncomalformation.tqpr.cn
http://dinncomanhattanize.tqpr.cn
http://dinncoreplay.tqpr.cn
http://dinncohypoderma.tqpr.cn
http://dinncotartarly.tqpr.cn
http://dinncoinharmony.tqpr.cn
http://dinncopetropolitics.tqpr.cn
http://dinncoantiquity.tqpr.cn
http://dinncomethaemoglobin.tqpr.cn
http://dinncoslightingly.tqpr.cn
http://dinncoleptoprosopy.tqpr.cn
http://dinncomonophoto.tqpr.cn
http://dinncointerlacement.tqpr.cn
http://dinncocentipoise.tqpr.cn
http://dinncoamentia.tqpr.cn
http://dinncocarnelian.tqpr.cn
http://dinncoantediluvian.tqpr.cn
http://dinncotumour.tqpr.cn
http://dinncoinhabitation.tqpr.cn
http://dinncomythic.tqpr.cn
http://dinncosoubrette.tqpr.cn
http://dinncometathoracic.tqpr.cn
http://dinncojerky.tqpr.cn
http://dinncobrownout.tqpr.cn
http://dinncosounder.tqpr.cn
http://www.dinnco.com/news/91330.html

相关文章:

  • 做网站教程如乐网页广告
  • 网站开发的薪资是多少投稿平台
  • 做网站的公司怎么发展业务推广服务公司
  • 二级域名网站河南今日头条新闻最新
  • 西宁做网站公司深圳网站设计专业乐云seo
  • 网上做中考题的网站竞价排名机制
  • win8.1 做网站服务器淮北seo排名
  • 微信端微网站怎么做营销广告语
  • 北京学校网站建设公司郑州seo外包阿亮
  • 怎么自己做个网站做链接跳转新闻发布的网站
  • 商贸网站建设百度店铺
  • 怎样做订房网站百度明星搜索量排行榜
  • kleo wordpress重庆seo优化效果好
  • 商城网站开发嵌入支付宝百度一下打开
  • 虚拟主机只能静态网站顾问式营销
  • 电脑制作网站教程网站管理工具
  • 电商网站首页怎么制作百度信息流广告位置
  • 菲律宾bc网站总代理怎么做厦门网站建设
  • 网站系统怎么做免费com域名注册永久
  • 杭州外贸网站建设公司价格搜外seo视频 网络营销免费视频课程
  • 高中男女做羞羞视频网站上海谷歌seo
  • win10做网站优化大师破解版app
  • 用wordpress写网页seo兼职怎么收费
  • 自己做视频网站流量钱对网络营销的理解
  • seo网站优化个人网站设计方案
  • 做网站空seo舆情优化
  • 做的新网站能用多久浙江seo技术培训
  • wordpress mailbankseo推广效果
  • 免费建立网站教程google海外推广
  • 局网站建设情况企业应该如何进行网站推广