affinity

Set processor affinity for MATLAB engine (Windows 7)

淺唱寂寞╮ 提交于 2019-11-29 06:58:39
I'm developing an application in c++. One of the components of the application uses Matlab (via the Matlab engine) for data processing. At the same time, a data acquisition system is streaming data to disk. Occasionally, during periods of intensive Matlab processing, the acquisition system crashes. By setting the processor affinity of Matlab to a subset of available processors, this problem is resolved. However, as the application is launched a few times daily, and on multiple machines, manually setting the affinity each time is inconvenient. The trick of setting processor affinity via the

One core exclusively for my process [duplicate]

别来无恙 提交于 2019-11-28 15:48:41
Possible Duplicate: how to set CPU affinity of a particular pthread? Is there a way in Linux to disable one core for all processes except one process? I would like to have one core reserved only and only for my process. Expected behavior is as follows: Processes which will be spawned after my process, should not see this core and use the others. When my process is spawned, all processes which are utilizing this core, should be switched to other cores. Yes, there is. You want to create two cpusets, one with your isolated CPU and the other with all the rest of the CPUs. Assign your special

Activity的启动模式与flag详解

冷暖自知 提交于 2019-11-28 12:07:25
Activity有四种加载模式:standard(默认), singleTop, singleTask和 singleInstance。以下逐一举例说明他们的区别: standard:Activity的默认加载方法,即使某个Activity在 Task栈中已经存在,另一个activity通过Intent跳转到该activity,同样会新创建一个实例压入栈中。例如:现在栈的情况为:A B C D,在D这个Activity中通过Intent跳转到D,那么现在的栈情况为: A B C D D 。此时如果栈顶的D通过Intent跳转到B,则栈情况为:A B C D D B。此时如果依次按返回键,D D C B A将会依次弹出栈而显示在界面上。 singleTop:如果某个Activity的Launch mode设置成singleTop,那么当该Activity位于栈顶的时候,再通过Intent跳转到本身这个Activity,则将不会创建一个新的实例压入栈中。例如:现在栈的情况为:A B C D。D的Launch mode设置成了singleTop,那么在D中启动Intent跳转到D,那么将不会新创建一个D的实例压入栈中,此时栈的情况依然为:A B C D。但是如果此时B的模式也是singleTop,D跳转到B,那么则会新建一个B的实例压入栈中,因为此时B不是位于栈顶,此时栈的情况就变成了

Thread affinity with Windows, MSVC, and OpenMP

对着背影说爱祢 提交于 2019-11-28 07:55:01
问题 I want to bind the threads in my code to each physical core. With GCC I have successfully done this using sched_setaffinity so I no longer have to set export OMP_PROC_BIND=true . I want to do the same thing in Windows with MSVC. Windows and Linux using a different thread topology. Linux scatters the threads while windows uses a compact form. In other words in Linux with four cores and eight hyper-threads I only need to bind the threads to the first four processing units. In windows I set them

What is the difference between pthread_self() and gettid()? Which one should I use?

筅森魡賤 提交于 2019-11-28 06:50:59
I'm trying to set the CPU affinity of threads on Linux. I'd like to know which one of the following approaches is recommended: Get thread id using pthread_self() Set CPU affinity using pthread_setaffinity_np(....) by passing the thread id as an argument Get thread id using the gettid() call Set CPU affinity using sched_setaffinity(....) by passing the thread id in the place of the process id P.S: After setting the CPU affinity, I intend to increase the scheduling priority of the thread. They are not the same . Here are some bits I collected from TLPI (I couldn't find a large-enough block that

Identify processor (core) is used by specific thread

元气小坏坏 提交于 2019-11-28 03:54:18
问题 I would like to know if it is possible to identify physical processor (core) used by thread with specific thread-id ? For example, I have a multithreaded application that has two (2) threads ( thread-id = 10 and thread-id = 20 , for instance). I run the application on a system that has a dual core processor (core 1 and core 2). So, how do I to get core number used by thread with thread-id = 20 ? P.S. Windows platforms. Thank you, Denis. 回答1: Unless you use thread-affinity, threads are not

Set processor affinity for MATLAB engine (Windows 7)

本秂侑毒 提交于 2019-11-28 00:29:45
问题 I'm developing an application in c++. One of the components of the application uses Matlab (via the Matlab engine) for data processing. At the same time, a data acquisition system is streaming data to disk. Occasionally, during periods of intensive Matlab processing, the acquisition system crashes. By setting the processor affinity of Matlab to a subset of available processors, this problem is resolved. However, as the application is launched a few times daily, and on multiple machines,

How to use sched_getaffinity and sched_setaffinity in Linux from C?

穿精又带淫゛_ 提交于 2019-11-27 22:56:10
I am trying to: Run 16 copies concurrently with processor pinning (2 copies per core) Run 8 copies concurrently with processor pinning (2 copies per core) and flipping processor core to the furthest core after certain function say function 1 finishes. The problem I am facing is how to select the farthest processor. Some friends suggested to use sched_getaffinity and sched_setaffinity but I count not find any good examples. To use sched_setaffinity to make the current process run on core 7 you do this: cpu_set_t my_set; /* Define your cpu_set bit mask. */ CPU_ZERO(&my_set); /* Initialize it all

How to set processor affinity from Batch File for Windows XP?

守給你的承諾、 提交于 2019-11-27 14:07:26
问题 I've got a dual processor machine and I would like to launch an executable via a batch file on both processors. For example: (1) Launch Notepad.exe on Processor 1, and (2) Simultaneously, Notepad.exe on Processor 2 Currently, I'm using the following in my batch file, since my executable was "difficult" to launch and needed a return in order to run when launched: echo.|DoStuff.exe Thus, I would like to launch it and have it run on each processor. Thanks for any feedback provided. P.S. I don't

One core exclusively for my process [duplicate]

喜欢而已 提交于 2019-11-27 09:35:10
问题 Possible Duplicate: how to set CPU affinity of a particular pthread? Is there a way in Linux to disable one core for all processes except one process? I would like to have one core reserved only and only for my process. Expected behavior is as follows: Processes which will be spawned after my process, should not see this core and use the others. When my process is spawned, all processes which are utilizing this core, should be switched to other cores. 回答1: Yes, there is. You want to create