cpu-cores

Setting Ideal size of Thread Pool [duplicate]

社会主义新天地 提交于 2019-12-17 10:23:54
问题 This question already has an answer here : Performance Issues with newFixedThreadPool vs newSingleThreadExecutor (1 answer) Closed 6 years ago . What is the difference between- newSingleThreadExecutor vs newFixedThreadPool(20) in terms of Operating System and Programming point of view. Whenever I am running my program using newSingleThreadExecutor my program works very well and end to end latency(95th percentile) comes around 5ms . But as soon as I start running my program using-

Cannot allocate exclusively a CPU for my process

给你一囗甜甜゛ 提交于 2019-12-12 03:05:53
问题 I have a simple mono-threaded application that does almost pure processing It uses two int buffers of the same size It reads one-by-one all the values of the first buffer each value is a random index in the second buffer It reads the value at the index in the second buffer It sums all the values taken from the second buffer It does all the previous steps for bigger and bigger At the end, I print the number of voluntary and involuntary CPU context switches If the size of the buffers become

Android Threading with single core

爷,独闯天下 提交于 2019-12-11 02:46:23
问题 Just wondering if threading with one processor improves things for me. I am building an application that performs data intensive calculations (fft on pcm data) while a UI is running and needs to run smoothly. I have been looking at AsyncTask but was thinking: If I have a single core processor (600 MHz ARM 11 processor) running on my Optimus One, will threading make a difference? I thought for threads to run independantly you would need multiple processors? Or have I gone wrong somewhere? 回答1:

How to find the Number of CPU Cores via .NET/C#?

為{幸葍}努か 提交于 2019-12-10 23:24:50
问题 Is there a way via .NET/C# to find out the number of CPU cores? PS This is a straight code question, not a "Should I use multi-threading?" question! :-) 回答1: There are several different pieces of information relating to processors that you could get: Number of physical processors Number of cores Number of logical processors. These can all be different; in the case of a machine with 2 dual-core hyper-threading-enabled processors, there are 2 physical processors, 4 cores, and 8 logical

c++ std::async : faster on 4 cores compared to 8 cores

偶尔善良 提交于 2019-12-10 10:43:59
问题 I have 16000 jobs to perform. Each job is independent. There is no shared memory, no interprocess communication, no lock or mutex. I am on ubuntu 16.06. c++11. Intel® Core™ i7-8550U CPU @ 1.80GHz × 8 I use std::async to split jobs between cores. If I split the jobs into 8 (2000 per core), computation time is 145. If I split the jobs into 4 (4000 per core), computation time is 60. Output after reduce is the same in both case. If I monitor the CPU during computation (just using htop), things

How do we enable OpenMP to use multiple cores — glintenet

萝らか妹 提交于 2019-12-08 11:00:08
问题 I want to use glinternet a R function that implements a feature extraction methodology developed by the Stanford professor Trevor Hastie and a PhD student. The function has an argument numCores. According to the user manual: numCores Number of threads to run. For this to work, the package must be installed with OpenMP enabled. Default is 1 thread. I don't know though how to enable OpenMP. I have Windows 8. Your advice will be appreciated. 回答1: Here is the answer of the glinternet package

How does the JVM spread threads between CPU cores?

三世轮回 提交于 2019-12-08 05:16:27
问题 Can somebody help me to understand how JVM spread threads between available CPU cores? Here som my vision how it is work but pls correct me. So from the begining: when computer is started then bootstrap thread (usually thread 0 in core 0 in processor 0) starts up fetching code from address 0xfffffff0. All the rest CPUs/cores are in special sleep state called Wait-for-SIPI(WFS). Then after OS is loaded it starts managing processes and schedule them between CPU/cores sending a special inter

OpenMP: don't use hyperthreading cores (half `num_threads()` w/ hyperthreading)

[亡魂溺海] 提交于 2019-12-07 06:15:40
问题 In Is OpenMP (parallel for) in g++ 4.7 not very efficient? 2.5x at 5x CPU, I determined that the performance of my programme varies between 11s and 13s (mostly always above 12s, and sometimes as slow as 13.4s) at around 500% CPU when using the default #pragma omp parallel for , and the OpenMP speed up is only 2.5x at 5x CPU w/ g++-4.7 -O3 -fopenmp , on a 4-core 8-thread Xeon. I tried using schedule(static) num_threads(4) , and noticed that my programme always completes in 11.5s to 11.7s

How to start a thread on a specific core?

放肆的年华 提交于 2019-12-06 04:17:14
问题 I have a quad core CPU, and lets say I always want to start a Thread on the second core. Is that possible in C#? 回答1: Yes. Check out ProcessorAffinity for Windows or SetProcessorAffinity for XBox XNA. This is also discussed on another Stackoverflow question. 回答2: Yes, take a look at the ProcessorAffinity property for the thread. 回答3: Set ProcessorAffinity of the process: 0x0001 = 0000 0001 - run on 1st core ↑ 0x0002 = 0000 0010 - run on 2nd core ↑ 0x0003 = 0000 0011 - run on 1st and 2nd core

OpenMP: don't use hyperthreading cores (half `num_threads()` w/ hyperthreading)

丶灬走出姿态 提交于 2019-12-05 08:58:14
In Is OpenMP (parallel for) in g++ 4.7 not very efficient? 2.5x at 5x CPU , I determined that the performance of my programme varies between 11s and 13s (mostly always above 12s, and sometimes as slow as 13.4s) at around 500% CPU when using the default #pragma omp parallel for , and the OpenMP speed up is only 2.5x at 5x CPU w/ g++-4.7 -O3 -fopenmp , on a 4-core 8-thread Xeon. I tried using schedule(static) num_threads(4) , and noticed that my programme always completes in 11.5s to 11.7s (always below 12s) at about 320% CPU, e.g., runs more consistently, and uses less resources (even if the