青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

牽著老婆滿街逛

嚴(yán)以律己,寬以待人. 三思而后行.
GMail/GTalk: yanglinbo#google.com;
MSN/Email: tx7do#yahoo.com.cn;
QQ: 3 0 3 3 9 6 9 2 0 .

GNU CPU-Affinity

轉(zhuǎn)載自:http://www.gnu.org/s/libc/manual/html_node/CPU-Affinity.html

22.3.5 Limiting execution to certain CPUs

On a multi-processor system the operating system usually distributes the different processes which are runnable on all available CPUs in a way which allows the system to work most efficiently. Which processes and threads run can be to some extend be control with the scheduling functionality described in the last sections. But which CPU finally executes which process or thread is not covered.

There are a number of reasons why a program might want to have control over this aspect of the system as well:

  • One thread or process is responsible for absolutely critical work which under no circumstances must be interrupted or hindered from making process by other process or threads using CPU resources. In this case the special process would be confined to a CPU which no other process or thread is allowed to use.
  • The access to certain resources (RAM, I/O ports) has different costs from different CPUs. This is the case in NUMA (Non-Uniform Memory Architecture) machines. Preferably memory should be accessed locally but this requirement is usually not visible to the scheduler. Therefore forcing a process or thread to the CPUs which have local access to the mostly used memory helps to significantly boost the performance.
  • In controlled runtimes resource allocation and book-keeping work (for instance garbage collection) is performance local to processors. This can help to reduce locking costs if the resources do not have to be protected from concurrent accesses from different processors.

The POSIX standard up to this date is of not much help to solve this problem. The Linux kernel provides a set of interfaces to allow specifying affinity sets for a process. The scheduler will schedule the thread or process on CPUs specified by the affinity masks. The interfaces which the GNU C library define follow to some extend the Linux kernel interface.

— Data Type: cpu_set_t

This data set is a bitset where each bit represents a CPU. How the system's CPUs are mapped to bits in the bitset is system dependent. The data type has a fixed size; in the unlikely case that the number of bits are not sufficient to describe the CPUs of the system a different interface has to be used.

This type is a GNU extension and is defined in sched.h.

To manipulate the bitset, to set and reset bits, a number of macros is defined. Some of the macros take a CPU number as a parameter. Here it is important to never exceed the size of the bitset. The following macro specifies the number of bits in the cpu_set_t bitset.

— Macro: int CPU_SETSIZE

The value of this macro is the maximum number of CPUs which can be handled with a cpu_set_t object.

The type cpu_set_t should be considered opaque; all manipulation should happen via the next four macros.

— Macro: void CPU_ZERO (cpu_set_t *set)

This macro initializes the CPU set set to be the empty set.

This macro is a GNU extension and is defined in sched.h.

— Macro: void CPU_SET (int cpu, cpu_set_t *set)

This macro adds cpu to the CPU set set.

The cpu parameter must not have side effects since it is evaluated more than once.

This macro is a GNU extension and is defined in sched.h.

— Macro: void CPU_CLR (int cpu, cpu_set_t *set)

This macro removes cpu from the CPU set set.

The cpu parameter must not have side effects since it is evaluated more than once.

This macro is a GNU extension and is defined in sched.h.

— Macro: int CPU_ISSET (int cpu, const cpu_set_t *set)

This macro returns a nonzero value (true) if cpu is a member of the CPU set set, and zero (false) otherwise.

The cpu parameter must not have side effects since it is evaluated more than once.

This macro is a GNU extension and is defined in sched.h.

CPU bitsets can be constructed from scratch or the currently installed affinity mask can be retrieved from the system.

— Function: int sched_getaffinity (pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)

This functions stores the CPU affinity mask for the process or thread with the ID pid in the cpusetsize bytes long bitmap pointed to by cpuset. If successful, the function always initializes all bits in the cpu_set_t object and returns zero.

If pid does not correspond to a process or thread on the system the or the function fails for some other reason, it returns -1 and errno is set to represent the error condition.

ESRCH
No process or thread with the given ID found. 
EFAULT
The pointer cpuset is does not point to a valid object.

This function is a GNU extension and is declared in sched.h.

Note that it is not portably possible to use this information to retrieve the information for different POSIX threads. A separate interface must be provided for that.

— Function: int sched_setaffinity (pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)

This function installs the cpusetsize bytes long affinity mask pointed to by cpuset for the process or thread with the ID pid. If successful the function returns zero and the scheduler will in future take the affinity information into account.

If the function fails it will return -1 and errno is set to the error code:

ESRCH
No process or thread with the given ID found. 
EFAULT
The pointer cpuset is does not point to a valid object. 
EINVAL
The bitset is not valid. This might mean that the affinity set might not leave a processor for the process or thread to run on.

This function is a GNU extension and is declared in sched.h.

posted on 2010-10-31 15:55 楊粼波 閱讀(507) 評(píng)論(0)  編輯 收藏 引用


只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問(wèn)   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久精品国产久精国产一老狼 | 欧美精品久久一区| 午夜电影亚洲| 亚洲深夜福利在线| 亚洲婷婷综合久久一本伊一区| 亚洲精品国产精品乱码不99| 久久嫩草精品久久久精品一| 欧美一区综合| 久久婷婷综合激情| 欧美国产极速在线| 亚洲最黄网站| 欧美影院一区| 欧美成人精品激情在线观看| 欧美另类99xxxxx| 国产精品久久久久久久久久三级 | 亚洲自拍偷拍网址| 久久9热精品视频| 欧美gay视频激情| 国产精品久久99| 伊人一区二区三区久久精品| 最近中文字幕mv在线一区二区三区四区| 亚洲国产你懂的| 亚洲一区在线视频| 欧美激情第9页| 亚洲欧美日韩专区| 欧美成人免费在线| 国产日韩在线一区| 亚洲三级视频在线观看| 性久久久久久久| 最新成人在线| 久久国产成人| 国产精品激情偷乱一区二区∴| 一区二区三区在线视频免费观看 | 国产一区二区三区免费在线观看 | 午夜精品一区二区三区四区 | 欧美午夜性色大片在线观看| 国内揄拍国内精品少妇国语| 99精品视频免费全部在线| 黄色成人av网| 亚洲福利视频网站| 欧美一级视频| 欧美精品大片| 亚洲国产精品第一区二区| 亚洲欧美一区二区三区久久| 欧美成人综合| 久久99伊人| 国产日本亚洲高清| 亚洲专区一区| 亚洲免费成人av| 欧美xart系列在线观看| 红桃视频成人| 久久精品国产久精国产思思 | 欧美一区二区三区在线播放| 欧美视频一区二区| 99热这里只有成人精品国产| 老妇喷水一区二区三区| 欧美亚洲三级| 国产日韩欧美在线| 亚洲欧美在线高清| 夜夜躁日日躁狠狠久久88av| 欧美日韩 国产精品| 亚洲国产日韩一级| 欧美福利一区二区| 欧美成在线观看| 日韩视频在线观看国产| 欧美第十八页| 欧美精品色网| 亚洲婷婷国产精品电影人久久| 亚洲人成在线观看网站高清| 欧美大片一区| 9i看片成人免费高清| 亚洲乱码国产乱码精品精天堂 | 亚洲国产精品久久久久秋霞蜜臀 | 欧美日本中文字幕| 亚洲午夜av电影| 一本色道精品久久一区二区三区 | 亚洲高清视频在线观看| 免费的成人av| 你懂的亚洲视频| 亚洲精品久久久久中文字幕欢迎你 | 亚洲制服欧美中文字幕中文字幕| 日韩视频免费观看| 欧美一区二区三区免费大片| 欧美日韩精品一区二区三区| 亚洲精品在线视频观看| 亚洲精品一二| 国产精品视频xxx| 久久久福利视频| 久久影院午夜论| 在线一区免费观看| 欧美一区91| 亚洲日本视频| 亚洲影音一区| 欲色影视综合吧| 亚洲精品小视频在线观看| 国产精品视频免费观看| 另类天堂视频在线观看| 欧美日韩高清不卡| 久久激情视频免费观看| 欧美第十八页| 久久久久9999亚洲精品| 欧美成人精精品一区二区频| 午夜精品福利一区二区蜜股av| 久久精品国产欧美亚洲人人爽| 亚洲精品一区二区三区婷婷月| 一本大道久久精品懂色aⅴ| 精品不卡视频| 亚洲一二三区在线| 日韩视频精品| 久久精品一区二区| 亚洲女人av| 欧美精品色综合| 久久婷婷丁香| 国产精品乱人伦一区二区 | 亚洲婷婷综合色高清在线| 亚洲第一黄网| 久久福利毛片| 欧美一区二区视频在线| 欧美日韩国产小视频| 久久婷婷亚洲| 国产日产欧产精品推荐色 | 久久免费精品日本久久中文字幕| 亚洲免费在线播放| 欧美黄色免费| 亚洲丁香婷深爱综合| 国产一区二区三区高清| a4yy欧美一区二区三区| 亚洲人成网在线播放| 久久久久一本一区二区青青蜜月| 亚洲一区二区三区午夜| 欧美精品一区二区三区在线播放| 男人插女人欧美| 国产在线日韩| 久久大逼视频| 麻豆精品视频在线观看| 国产亚洲精品v| 欧美一区二区在线观看| 欧美一区二区三区在线视频| 国产精品丝袜91| 亚洲一区二区在线免费观看视频| 亚洲一区二区在线免费观看| 欧美日韩一区二区欧美激情| 日韩一二在线观看| 亚洲一区精品在线| 国产精品美女久久久久久久| 夜夜嗨网站十八久久| 亚洲黄色小视频| 在线观看亚洲| 久久美女性网| 猫咪成人在线观看| 伊人蜜桃色噜噜激情综合| 久久久久久日产精品| 欧美成人精品一区二区| 亚洲国产美国国产综合一区二区| 蜜臀久久久99精品久久久久久| 欧美韩日视频| 一本色道久久综合亚洲精品婷婷 | 久久精品视频在线| 久久免费高清视频| 亚洲国产精品成人精品| 欧美激情精品久久久六区热门 | 欧美另类综合| 亚洲五月婷婷| 久久综合亚州| 亚洲精品中文字幕有码专区| 欧美日在线观看| 亚洲一区在线免费| 另类春色校园亚洲| 夜久久久久久| 国产日韩欧美高清免费| 久久久欧美一区二区| 最新亚洲视频| 久久精品欧美| 一本色道久久综合亚洲91| 国产目拍亚洲精品99久久精品 | 久久精品国产99国产精品澳门| 亚洲国产一区二区a毛片| 欧美日韩精品一区视频| 欧美综合国产精品久久丁香| 亚洲国产导航| 欧美中文字幕视频| 亚洲看片网站| 国产午夜精品一区二区三区视频 | 亚洲第一成人在线| 国产精品午夜av在线| 欧美jizzhd精品欧美巨大免费| 亚洲一区二区三区乱码aⅴ蜜桃女 亚洲一区二区三区乱码aⅴ | 国产精品网站在线播放| 麻豆久久精品| 欧美一级视频免费在线观看| 亚洲精品乱码久久久久久按摩观| 久久国产黑丝| 国产精品99久久久久久久vr| 国内精品嫩模av私拍在线观看| 欧美日韩日韩| 免费看亚洲片| 久久九九久精品国产免费直播| 99热精品在线| 亚洲精品国产精品久久清纯直播| 亚洲黄一区二区三区|