multicore

How can I write a lock free structure?

ぐ巨炮叔叔 提交于 2019-11-28 18:12:11
In my multithreaded application and I see heavy lock contention in it, preventing good scalability across multiple cores. I have decided to use lock free programming to solve this. How can I write a lock free structure? Short answer is: You cannot. Long answer is: If you are asking this question, you do not probably know enough to be able to create a lock free structure. Creating lock free structures is extremely hard, and only experts in this field can do it. Instead of writing your own, search for an existing implementation. When you find it, check how widely it is used, how well is it

Visual Studio 2010, how to build projects in parallel on multicore

大城市里の小女人 提交于 2019-11-28 17:33:00
I have a big solution with more than 40 projects. Almost half of them are test projects. In my project we use both Code Contracts, Code Analysis, Style Analysis. I want to be able to build the projects that are not dependent in parallel on my quad core CPU. How can I setup msbuild to build the projects in parallel? In Visual Studio: Tools | Options | Projects and Solutions | Build and Run. This should default to your CPU count. From the command line: msbuild /maxcpucount[:n] (is n is not specified, then it will use the CPU count). You could launch the build in MSBuild in parallel by : Setting

How do I utilise all the cores for nmake?

杀马特。学长 韩版系。学妹 提交于 2019-11-28 16:50:07
I just got a new quad core computer and noticed that nmake is only using 1 process. I used to use make which had the switch -j4 for launching 4 processes. What is the nmake equivalent? [edit] Based on the information below I have been able to add a command to my qmake project file: QMAKE_CXXFLAGS += /MP Which effectively did it for me. Many thanks. According to MSDN , there's no such option for nmake . You can however make the compiler build multiple files in parallel by using the /MP option with the VC++ command line compiler and passing multiple files at the same time: > cl /MP a.cpp b.cpp c

Which CPU architectures support Compare And Swap (CAS)?

▼魔方 西西 提交于 2019-11-28 16:23:00
just curious to know which CPU architectures support compare and swap atomic primitives? jdkoftinoff Powerpc has more powerful primitives available: "lwarx" and "stwcx" lwarx loads a value from memory but remembers the location. Any other thread or cpu that touches that location will cause the "stwcx", a conditional store instruction, to fail. So the lwarx /stwcx combo allows you to implement atomic increment / decrement, compare and swap, and more powerful atomic operations like "atomic increment circular buffer index" A different and easier way to answer this question may be to list

Multiprocessing or Multithreading?

蓝咒 提交于 2019-11-28 15:55:13
I'm making a program for running simulations in Python, with a wxPython interface. In the program, you can create a simulation, and the program renders (=calculates) it for you. Rendering can be very time-consuming sometimes. When the user starts a simulation, and defines an initial state, I want the program to render the simulation continuously in the background, while the user may be doing different things in the program. Sort of like a YouTube-style bar that fills up: You can play the simulation only up to the point that was rendered. Should I use multiple processes or multiple threads or

Haskell lightweight threads overhead and use on multicores

与世无争的帅哥 提交于 2019-11-28 15:16:16
I've been reading the "Real World Haskell" book, the chapter on concurrency and parallelism. My question is as follows: Since Haskell threads are really just multiple "virtual" threads inside one "real" OS-thread, does this mean that creating a lot of them (like 1000) will not have a drastic impact on performance? I.e., can we say that the overhead incurred from creating a Haskell thread with forkIO is (almost) negligible? Please bring pactical examples if possible. Doesn't the concept of lightweight threads prevent us from using the benefints of multicore architectures? As I understand, it is

How are you taking advantage of Multicore?

為{幸葍}努か 提交于 2019-11-28 15:08:26
As someone in the world of HPC who came from the world of enterprise web development, I'm always curious to see how developers back in the "real world" are taking advantage of parallel computing. This is much more relevant now that all chips are going multicore , and it'll be even more relevant when there are thousands of cores on a chip instead of just a few. My questions are: How does this affect your software roadmap? I'm particularly interested in real stories about how multicore is affecting different software domains, so specify what kind of development you do in your answer ( e.g.

C++ Parallelization Libraries: OpenMP vs. Thread Building Blocks [closed]

£可爱£侵袭症+ 提交于 2019-11-28 14:37:39
问题 I'm going to retrofit my custom graphics engine so that it takes advantage of multicore CPUs. More exactly, I am looking for a library to parallelize loops. It seems to me that both OpenMP and Intel's Thread Building Blocks are very well suited for the job. Also, both are supported by Visual Studio's C++ compiler and most other popular compilers. And both libraries seem quite straight-forward to use. So, which one should I choose? Has anyone tried both libraries and can give me some cons and

How to use multicore with loops in R

筅森魡賤 提交于 2019-11-28 13:05:56
问题 I need to speed up this built in loops how can I do please ? for(M_P in 0:9) { for(M_D in 0:(9-M_P)) { for(M_A in 0:(9-M_P-M_D)) { for(M_CC in 0:(9-M_P-M_D-M_A)) { for(M_CD in (9-M_P-M_D-M_A-M_CC)) { for(G_D in 0:9) { for(G_A in 0:(9-G_D)) { for(G_CC in 0:(9-G_D-G_A)) { for(G_CD in (9-G_D-G_A-G_CC)) { for(S_D in 0:9) { for(S_A in 0:(9-S_D)) { for(S_CC in 0:(9-S_D-S_A)) { for(S_CD in (9-S_D-S_A-S_CC)) { for(Q_P in 0:3) { for(Q_D in 0:(3-Q_P)) { for(Q_A in 0:(3-Q_P-Q_D)) { for(Q_CC in 0:(3-Q_P

Was Visual Studio 2008, 2010 or 2012 (v11) written to use multi cores?

感情迁移 提交于 2019-11-28 10:50:50
Basically i want to know if the visual studio IDE and/or compiler in 2010 and 2012 was written to make use of a multi core environment (i understand we can target multi core environments in all versions using parallelism, but that is not my question). I am trying to decide on if i should get a higher clock dual core or a lower clock quad core, as i want to try and figure out which processor will give me the absolute best possible experience with Visual Studio 2010 or 2012 (v11) (ide and background compiler). If they are running the most important section (background compiler and other ide