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

牽著老婆滿街逛

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

GNU CPU-Affinity

轉載自: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) 評論(0)  編輯 收藏 引用

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            国内外成人免费视频 | 亚洲三级免费观看| 久久久久一本一区二区青青蜜月| 午夜一区二区三视频在线观看| 欧美日韩综合网| 亚洲丝袜av一区| 久久一区二区三区四区五区| 欧美一区二区三区四区在线观看地址| 欧美日韩国产小视频| 国产一区二区三区四区五区美女| 一区二区三区高清在线观看| 亚洲欧美国产另类| 黄色亚洲大片免费在线观看| 国产在线观看一区| 亚洲高清视频中文字幕| 国产精品欧美精品| 久久欧美中文字幕| 亚洲午夜黄色| 久久精品国产91精品亚洲| 99精品热6080yy久久 | 亚洲国产视频一区| 欧美日韩p片| 可以看av的网站久久看| 久久婷婷麻豆| 一本色道88久久加勒比精品| 亚洲伊人第一页| 洋洋av久久久久久久一区| 午夜精品久久久久久久白皮肤| 亚洲精品乱码久久久久久| 欧美精品成人在线| 久久精品99国产精品酒店日本| 美女日韩欧美| 久久综合九色九九| 欧美日韩精品二区第二页| 国内精品久久久久久久影视麻豆 | 夜夜嗨av色综合久久久综合网| 午夜精品福利一区二区蜜股av| 欧美成人精品一区二区| 久久综合久久久久88| 国产精品三上| 国产欧美日本| 午夜精品婷婷| 免费看亚洲片| 久久成人18免费网站| 欧美日韩国产三区| 韩日成人av| 欧美亚洲在线| 一区二区日韩| 欧美日韩精品高清| 99re6这里只有精品| 亚洲三级免费电影| 欧美**字幕| 欧美激情亚洲另类| 99精品热6080yy久久| 欧美成人中文字幕| 精品福利电影| 亚洲人在线视频| 亚洲欧美激情诱惑| 99精品国产99久久久久久福利| 欧美精品免费播放| 在线视频欧美日韩| 欧美一级成年大片在线观看| 99热在线精品观看| 欧美日韩少妇| 黄色日韩精品| 久久亚洲美女| 美女精品国产| 亚洲精品在线三区| 欧美一区二区视频在线| 久久天天躁狠狠躁夜夜av| 欧美中文字幕在线播放| 欧美精品久久久久久久久老牛影院| 在线观看一区欧美| 午夜在线精品| 亚洲欧美在线x视频| 国产一区二区三区在线免费观看| 久久尤物视频| 欧美激情亚洲另类| 亚洲一区高清| 亚洲盗摄视频| 亚洲永久精品国产| 国产综合色精品一区二区三区| 久久久久久69| 亚洲一级免费视频| 国产一区二区三区在线观看精品 | 激情av一区二区| 亚洲国产精品成人精品| 欧美在线1区| 亚洲国产欧美久久| 99精品视频免费观看| 国产视频一区三区| 亚洲欧美日韩专区| 欧美va亚洲va国产综合| 欧美国产日韩视频| 亚洲第一黄色网| av成人免费在线| 99精品视频一区| 欧美日韩在线免费观看| 亚洲免费在线视频一区 二区| 午夜在线不卡| 一本大道久久a久久综合婷婷 | 这里只有精品视频| 娇妻被交换粗又大又硬视频欧美| 日韩一级黄色大片| 欧美激情影音先锋| 久久精品亚洲精品| 一本一本久久a久久精品综合麻豆 一本一本久久a久久精品牛牛影视 | 欧美伊人久久大香线蕉综合69| 狠色狠色综合久久| 国产精品日韩一区二区三区| 免费在线观看日韩欧美| 欧美一区二区视频免费观看| 亚洲一区不卡| 午夜精品久久久久久| 久久国产精品久久久久久电车| 狠狠色丁香婷婷综合| 亚洲精品国产精品乱码不99按摩| 国产精品高潮呻吟久久| 亚洲综合视频1区| 麻豆乱码国产一区二区三区| 午夜亚洲一区| 欧美午夜免费电影| 欧美一区二区三区男人的天堂| 欧美a级大片| 美国成人直播| 亚洲在线视频| 亚洲色图制服丝袜| 亚洲免费视频一区二区| 国产精品久久久久国产精品日日 | 免费91麻豆精品国产自产在线观看| 欧美日韩免费精品| 亚洲国内高清视频| 亚洲人成久久| 欧美电影在线播放| 亚洲国产成人高清精品| 亚洲精品乱码久久久久久黑人 | 亚洲一区二区毛片| 亚洲一区二区欧美| 亚洲一区二区三区精品在线观看| 久久国产日韩欧美| 国产精品综合色区在线观看| 久久视频国产精品免费视频在线| 欧美一区二区在线播放| 久久精品二区亚洲w码| 国产日韩欧美| 久久精品国产一区二区三区免费看| 久久aⅴ国产欧美74aaa| 免费成人毛片| 亚洲国产精品成人久久综合一区| 亚洲激情午夜| 欧美电影打屁股sp| av成人免费在线观看| 午夜精品久久久久久久99黑人| 国产日本欧美一区二区三区| 久久久人成影片一区二区三区| 亚洲国产精品免费| 亚洲制服欧美中文字幕中文字幕| 国产精品久久久久久久久婷婷| 亚洲综合激情| 免费久久99精品国产| 一个色综合导航| 国产日产欧产精品推荐色| 久久香蕉国产线看观看网| 亚洲日本激情| 欧美亚洲在线播放| 亚洲国产影院| 国产精品私拍pans大尺度在线| 欧美中文字幕在线| 亚洲激情六月丁香| 在线播放精品| 亚洲一区二区精品| 久久综合九色综合网站| 一本色道久久综合亚洲精品不卡| 国产农村妇女精品一二区| 免费成人av| 午夜伦理片一区| 亚洲破处大片| 久久久高清一区二区三区| 亚洲精品乱码| 国产一区二区三区视频在线观看| 欧美二区视频| 欧美一区视频| 一本一本久久a久久精品综合麻豆 一本一本久久a久久精品牛牛影视 | 欧美亚洲成人精品| 久久久噜噜噜久噜久久| 99精品视频一区| 欧美高清在线视频| 亚洲国产成人在线视频| 国产精品成人一区| 免费视频亚洲| 欧美伊人久久大香线蕉综合69| 日韩午夜电影| 中日韩美女免费视频网站在线观看| 国产日韩欧美自拍| 欧美视频在线不卡| 欧美久久99| 亚洲午夜精品久久久久久app| 亚洲第一色在线| 美女91精品| 免费成人黄色片|