multicore

.NET movement of threads between cores

微笑、不失礼 提交于 2019-11-30 19:04:57
Follow up question from Multi-core usage, threads, thread-pools . Are threads moved from one core to another during their lifetime? Of course. Imagine you have three threads running on a dualcore system. Show me a fair schedule that doesn't involve regularly moving threads between cores. This is my first time on this site, so I didn't have enough rep to comment I guess. I decided to just make a new question referencing the one I wanted to comment on. What is the process of selecting a core to move a thread to. Is it like the scheduler has a list of threads that need processing time and as one

Using R Parallel with other R packages

爱⌒轻易说出口 提交于 2019-11-30 17:47:43
问题 I am working on a very time intensive analysis using the LQMM package in R. I set the model to start running on Thursday, it is now Monday, and is still running. I am confident in the model itself (tested as a standard MLM), and I am confident in my LQMM code (have run several other very similar LQMMs with the same dataset, and they all took over a day to run). But I'd really like to figure out how to make this run faster if possible using the parallel processing capabilities of the machines

“foreach” loop : Using all cores in R (especially if we are sending sql queries inside foreach loop)

杀马特。学长 韩版系。学妹 提交于 2019-11-30 17:29:19
问题 I intend to use "foreach" to uitlize all the cores in my CPU. The catch is i need to send a sql query inside the loop. The script is working fine with normal 'for' loop, but it is giving following error when i change it to 'foreach'. The error is : select: Interrupted system call select: Interrupted system call select: Interrupted system call Error in { : task 1 failed - "expired MySQLConnection" The code i used is : library(foreach) library(doMC) library(RMySQL) library(multicore)

Multi-core Android

可紊 提交于 2019-11-30 15:27:42
I have run simple parallel algorithm drawing the mandelbrot set to test parallel computations on a Nexus 7 (Tegra 3, 4+1 cores). After running several times I get 1.5 seconds for serial and 1.0 for parallel, but parallel and serial come really close to each other at 1.3 seconds. The square is 700x700 pixels, and the mandelbrot code I use is from http://rosettacode.org/wiki/Mandelbrot_set#Java The parallel implementation runs two halves of mandelbrot like this public void mandelbrotParallel() { Thread t1 = new Thread(new Runnable() { public void run() { mandelbrotOne(); } }); Thread t2 = new

How do memory fences work?

梦想与她 提交于 2019-11-30 13:10:13
问题 I need to understand memory fences in multicore machines. Say I have this code Core 1 mov [_x], 1; mov r1, [_y] Core 2 mov [_y], 1; mov r2, [_x] Now the unexpected results without memory fences would be that both r1 and r2 can be 0 after execution. In my opinion, to counter that problem, we should put memory fence in both codes, as putting it to only one would still not solve the problem. Something like as follows... Core 1 mov [_x], 1; memory_fence; mov r1, [_y] Core 2 mov [_y], 1; memory

How to use GNU make --max-load on a multicore Linux machine?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 12:30:19
From the documentation for GNU make: http://www.gnu.org/software/make/manual/make.html#Parallel When the system is heavily loaded, you will probably want to run fewer jobs than when it is lightly loaded. You can use the ‘-l’ option to tell make to limit the number of jobs to run at once, based on the load average. The ‘-l’ or ‘--max-load’ option is followed by a floating-point number. For example, -l 2.5 will not let make start more than one job if the load average is above 2.5. The ‘-l’ option with no following number removes the load limit, if one was given with a previous ‘-l’ option. More

Can I get `cabal install` to use multiple cores?

南楼画角 提交于 2019-11-30 11:46:06
问题 Does anyone know how to get cabal install to exploit parallelism? I'm compiling with GHC, and while I don't know if GHC itself can do parallel builds, surely cabal install could run multiple compilations in parallel, no? At least for distinct, independent packages? Does anyone know if it is possible and how to do it? 回答1: There was a Google Summer of Code project this summer to parallelize cabal-install . While it hasn't been merged into the mainline yet, the linked article provides

Threads vs Cores

主宰稳场 提交于 2019-11-30 11:38:24
Say if I have a processor like this which says # cores = 4, # threads = 4 and without Hyper-threading support. Does that mean I can run 4 simultaneous program/process (since a core is capable of running only one thread)? Or does that mean I can run 4 x 4 = 16 program/process simultaneously? From my digging, if no Hyper-threading, there will be only 1 thread (process) per core. Correct me if I am wrong. That's basically correct, with the obvious qualifier that most operating systems let you execute far more tasks simultaneously than there are cores or threads, which they accomplish by

Possible sources for random number seeds

不打扰是莪最后的温柔 提交于 2019-11-30 09:00:30
问题 Two points -- first, the example is in Fortran, but I think it should hold for any language; second, the built in random number generators are not truly random and other generators exist, but we're not interested in using them for what we're doing. Most discussions on random seeds acknowledge that if the program doesn't seed it at run-time, then the seed is generated at compile time. So, the same sequence of numbers is generated every time the program is run, which is not good for random

Which haskell library will let me save a 2D array/vector to a png/jpg/gif… file?

好久不见. 提交于 2019-11-30 08:28:54
I am playing around with haskell, starting with simple plotting programs to wet my feet. I need a library that will let me save a 2D array/vector to an image file. I don't want to write a list of colors. I want to use containers that are meant for array/vector like computations and can be (well, almost ) automagically parallelized. EDIT Ability to store color images is a must. I'd start with PGM library. This is a very simple uncompressed graymap format. Almost no additinal dependencies. You can convert PGM to other formats with ImageMagick or other tools. PGM supports generic IArray interface