| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 9434 人关注过本帖
标题:计算机
只看楼主 加入收藏
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
The interrupt gate is used to specify an interrupt service routine.  

 When you do INT 50 in assembly, running in protected mode,

the CPU looks up the 50th entry(located at 50*8) in the IDT.  

Then the interrupt gates selector and offset value is loaded.  

The selector and offset is used to call the interrupt service routine.  

When the IRET instruction is read , it returns.


[ 本帖最后由 madfrogme 于 2012-10-5 00:04 编辑 ]

The quieter you become, the more you can hear
2012-10-04 13:31
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
进程的重要性不仅由优先级指定的,而且还需要考虑保存在task_struct->se.load 的负荷权重

se(struct sched_entity)

set_load_weight 负责根据进程类型及静态优先级计算负荷权重

一般概念是这样, 进程每降低一个nice值, 则多获得10% 的CPU时间, 每升高一个nice 值,

则放弃10%的CPU时间。 为执行该策略, 内核将优先级转换为权重值

实时进程的权重是普通进程的两倍
.


[ 本帖最后由 madfrogme 于 2012-10-5 00:03 编辑 ]

The quieter you become, the more you can hear
2012-10-04 23:00
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
静态优先级(static_prio)是进程启动时分配的优先级

普通优先级(normal_priority) 表示基于进程的静态优先级和调度策略计算出的优先级

即使普通进程和实时进程具有相同的静态优先级, 其普通优先级也是不同的

进程分支时,子进程会继承普通优先级

The quieter you become, the more you can hear
2012-10-04 23:30
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
task_struct 中的 unsigned int policy 保存了对该进程应用的调度策略, Linux支持5个可能的值

SCHED_NORMAL 用于普通进程。它们通过完全公平调度器来处理

SCHED_BATCH 和 SCHED_IDLE 也通过完全公平调度器来处理,不过可用于次要的进程

SCHED_RR 和 SCHED_FIFO 用于实现软实时进程。由实时调度器类处理

The quieter you become, the more you can hear
2012-10-04 23:45
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
PID namespace は独立したマシンに見えるように PID の付け方を考慮したタスクセットを作成する機能です。

言い換えると、異なる namespace であれば同一の PID を持つことができるようになる機能です。

新たな namespace を作るには、CLONE_NEWPID フラグをセットした上で clone(2)システムコールを発行するだけでいいです。


[ 本帖最后由 madfrogme 于 2012-10-5 19:04 编辑 ]

The quieter you become, the more you can hear
2012-10-05 17:59
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
当进程调用abort() 函数时产生   SIGABRT 夭折信号

当由alarm() 函数设置的计时器超时后产生 SIGALRM 闹钟信号

linux 2.4.22支持31种不同信号

不存在编号为0 的信号, kill 函数对信号编号0 有特殊的应用

POSIX.1 将此种信号编号值称为空信号

对执行一个无效内存引用的进程产生的 SIGSEGV信号

进程调用kill()函数可将信号发送给另一个相同所有者的进程或进程组,或发送信号的是超级用户


[ 本帖最后由 madfrogme 于 2012-10-8 00:14 编辑 ]

The quieter you become, the more you can hear
2012-10-07 22:43
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
当后台执行一个进程时, 例如:

cc main.c &

shell 自动将后台进程对中断和退出信号的处理方式设置为忽略。

于是, 当按中断键时就不会影响后台进程。 如果没有执行这样的处理,

那么当按中断键时, 它不但会终止前台进程,还会终止所有后台进程。

The quieter you become, the more you can hear
2012-10-08 10:55
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
fd = open("./jim.mymemory", O_RDWR| O_CREAT, S_IRUSR| S_IWUSR );


S_IRUSR
  Permits the file's owner to read it.

S_IWUSR
  Permits the file's owner to write to it.

S_IRGRP
  Permits the file's group to read it.

S_IWGRP
  Permits the file's group to write to it.

The quieter you become, the more you can hear
2012-10-09 15:05
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
Upon successful completion, lseek() returns the resulting offset location as measured in bytes from the beginning of the file.

Otherwise, a value of -1 is returned and errno is set to indicate the error.

The quieter you become, the more you can hear
2012-10-09 15:10
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
msync -- synchronize a mmaped region

The msync() system call writes modified whole pages back to the filesystem and updates the file modification time.

Only those pages containing adds and len-1 succeeding locations will be examined.

int msync(void * addr, size_t len, int flags);

msync(addr,sizeof(int),MS_SYNC|MS_INVALIDATE);

MS_SYNC        Perform synchronous writes
MS_INVALIDATE        Invalidate all cached data

The quieter you become, the more you can hear
2012-10-09 15:23
快速回复:计算机
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013030 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved