multicore

What parallel programming model do you recommend today to take advantage of the manycore processors of tomorrow?

落花浮王杯 提交于 2019-11-28 02:48:23
If you were writing a new application from scratch today, and wanted it to scale to all the cores you could throw at it tomorrow, what parallel programming model/system/language/library would you choose? Why? I am particularly interested in answers along these axes: Programmer productivity / ease of use (can mortals successfully use it?) Target application domain (what problems is it (not) good at?) Concurrency style (does it support tasks, pipelines, data parallelism, messages...?) Maintainability / future-proofing (will anybody still be using it in 20 years?) Performance (how does it scale

Threads & Processes Vs MultiThreading & Multi-Core/MultiProcessor : How they are mapped?

三世轮回 提交于 2019-11-28 02:47:46
I was very confused but the following thread cleared my doubts: Multiprocessing, Multithreading,HyperThreading, Multi-core But it addresses the queries from the hardware point of view. I want to know how these hardware features are mapped to software? One thing that is obvious is that there is no difference between MultiProcessor(=Mutlicpu) and MultiCore other than that in multicore all cpus reside on one chip(die) where as in Multiprocessor all cpus are on their own chips & connected together. So, mutlicore/multiprocessor systems are capable of executing multiple processes (firefox

Matlabpool number of threads vs core

给你一囗甜甜゛ 提交于 2019-11-28 00:56:04
问题 I have a laptop running Ubuntu on Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz . According to Intel website for the above processor (located here), this processor has two cores and can run 4 threads at a time in parallel (because although it has 2 physical cores it has 4 logical cores). When I start matlabpool it starts with local configuration and says it has connected to 2 labs. I suppose this means that it can run 2 threads in parallel. Does it not know that the CPU can actually run 4 threads

different behavior when using different number of multicoring workers

↘锁芯ラ 提交于 2019-11-27 23:04:33
I am playing around a bit with my program (trying to multicore a few parts) and I've noticed the "CPU history" looks a bit different, depend on how many workers I start. 2-4 workers seems to produce a "stable" workflow, however pegging 5-8 workers produces erratic behavior (from zero to max, see pictures). I should point out that all runs started out with "smooth" max capacity (e.g. 2 cores with only 25%), and started to exhibit erratic behavior only after a minute or so. What's going on? I have 4 core processor, and do you think this behavior may be related to this fact? I hope you can see

Assembly instructions to find how many threads are enabled in a multi-core system

梦想的初衷 提交于 2019-11-27 22:40:33
问题 I'm working on a bare-bones system in which I need to determine sometime after boot how many cores and threads are enabled, so that I can send them SIPI events. I also want each thread to know which thread it is. For instance, in a single-core configuration with HT enabled, we have (for instance, Intel Atom): thread 0 --> core 0 thread 0 thread 1 --> core 0 thread 1 While in a dual-core configuration with no HT we have (for instance, Core 2 Duo): thread 0 --> core 0 thread 0 thread 1 --> core

Why doesn't the Go statement execute in parallel?

南楼画角 提交于 2019-11-27 21:35:57
I'm testing this Go code on my VirtualBoxed Ubuntu 11.4 package main import ("fmt";"time";"big") var c chan *big.Int func sum( start,stop,step int64) { bigStop := big.NewInt(stop) bigStep := big.NewInt(step) bigSum := big.NewInt(0) for i := big.NewInt(start);i.Cmp(bigStop)<0 ;i.Add(i,bigStep){ bigSum.Add(bigSum,i) } c<-bigSum } func main() { s := big.NewInt( 0 ) n := time.Nanoseconds() step := int64(4) c = make( chan *big.Int , int(step)) stop := int64(100000000) for j:=int64(0);j<step;j++{ go sum(j,stop,step) } for j:=int64(0);j<step;j++{ s.Add(s,<-c) } n = time.Nanoseconds() - n fmt.Println

Are you concerned about multicore? [closed]

旧城冷巷雨未停 提交于 2019-11-27 17:44:00
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . This is undeniable: multicore computers are here to stay. So is this: efficient multicore programming is pretty difficult. It's not

How to control which core a process runs on?

爷,独闯天下 提交于 2019-11-27 17:23:13
I can understand how one can write a program that uses multiple processes or threads: fork() a new process and use IPC, or create multiple threads and use those sorts of communication mechanisms. I also understand context switching. That is, with only once CPU, the operating system schedules time for each process (and there are tons of scheduling algorithms out there) and thereby we achieve running multiple processes simultaneously. And now that we have multi-core processors (or multi-processor computers), we could have two processes running simultaneously on two separate cores. My question is

Why does this Java code not utilize all CPU cores?

不问归期 提交于 2019-11-27 16:04:23
问题 The attached simple Java code should load all available cpu core when starting it with the right parameters. So for instance, you start it with java VMTest 8 int 0 and it will start 8 threads that do nothing else than looping and adding 2 to an integer. Something that runs in registers and not even allocates new memory. The problem we are facing now is, that we do not get a 24 core machine loaded (AMD 2 sockets with 12 cores each), when running this simple program (with 24 threads of course).

Does pthread_mutex_lock contains memory fence instruction?

你离开我真会死。 提交于 2019-11-27 13:44:19
Do pthread_mutex_lock and pthread_mutex_unlock functions call memory fence/barrier instructions? Or do the the lower level instructions like compare_and_swap implicity have memory barriers? Do pthread_mutex_lock and pthread_mutex_unlock functions call memory fence/barrier instructions? They do, as well as thread creation. Note, however, there are two types of memory barriers: compiler and hardware. Compiler barriers only prevent the compiler from reordering reads and writes and speculating variable values, but don't prevent the CPU from reordering. The hardware barriers prevent the CPU from