Questions tagged [multiprocessor]
71 questions
32
votes
4 answers
Gradle android build for different processor architectures
I want to build 4 separate apks for 4 different Android CPU processor architectures (armeabi armeabi-v7a x86 mips) using Gradle.
I have native OpenCV libraries built for 4 CPU architectures in the libs folder.
libs
-armeabi
-armeabi-v7a
…

Blukee
- 389
- 1
- 4
- 7
18
votes
5 answers
What happens if two process in different processors try to acquire the lock at EXACTLY same time
Ok, so I am reading about synchronization, and I read through various algorithms such as spinlocks, semaphores, and mutex to avoid race condition.
However, these algorithms can't prevent race condition in SMP when multiple proceses access the data…

SHH
- 3,226
- 1
- 28
- 41
15
votes
5 answers
Stop reading process output in Python without hang?
I have a Python program for Linux almost looks like this one :
import os
import time
process = os.popen("top").readlines()
time.sleep(1)
os.popen("killall top")
print process
the program hangs in this line :
process =…

Barakat
- 153
- 1
- 1
- 4
14
votes
6 answers
"Work stealing" vs. "Work shrugging"?
Why is it that I can find lots of information on "work stealing" and nothing on "work shrugging" as a dynamic load-balancing strategy?
By "work-shrugging" I mean pushing surplus work away from busy processors onto less loaded neighbours, rather than…

John
- 47
- 1
- 5
11
votes
2 answers
How locks are implemented on multiple cores
For a uni-processor, the lock algorithm is pretty simple.
Lock(threadID) {
Disable Interrupts
If lock is already owned by same thread{
Restore Interrupts
return
}
if lock is free {
make lock busy
set current thread as the…

user447851
- 163
- 2
- 6
11
votes
4 answers
How do threaded systems cope with shared data being being cached by different cpus?
I'm coming largely from a c++ background, but I think this question applies to threading in any language. Here's the scenario:
We have two threads (ThreadA and ThreadB), and a value x in shared memory
Assume that access to x is appropriately…

csj
- 21,818
- 2
- 20
- 26
9
votes
3 answers
Force C# application to use a single core in a PC with a multicore processor
I am using the Haptek People Putty player for my C# application and I've seen people say in the forums that it doesn't work well with a multicore processor. My application runs well on my Core 2 Duo laptop but it lags a lot when I try running it on…

Paul
- 1,128
- 1
- 11
- 19
8
votes
2 answers
Best Practice for Stopwatch in multi processors machine?
I found a good question for measuring function performance, and the answers recommend to use Stopwatch as follows
Stopwatch sw = new Stopwatch();
sw.Start();
//DoWork
sw.Stop();
//take sw.Elapsed
But is this valid if you are running under multi…

Ahmed
- 7,148
- 12
- 57
- 96
8
votes
7 answers
Parallel coding Vs Multithreading (on single cpu)
can we use interchangeably "Parallel coding" and "Multithreading coding " on single cpu?
i am not much experience in both,
but i want to shift my coding style to any one of the above.
As i found now a days many single thred application are…

K. Santosh
- 149
- 1
- 1
- 9
6
votes
4 answers
What can I do to make my C# application take advantage of multiple processor cores?
I've been doing some tests about the way a .NET C# application uses resources, like CPU or memory. I wrote some loops that calculate values for a large amount of numbers and I'm satisfied with the weight of the algorithm.
I have a Quad Core 2.4 GHz…

Rosmarine Popcorn
- 10,761
- 11
- 59
- 89
6
votes
3 answers
How can I modify my perl script to use multiple processors?
Hi I have a simple script that takes a file and runs another Perl script on it. The script does this to every picture file in the current folder. This is running on a machine with 2 quad core Xeon processors, 16gb of ram, running RedHat Linux.…

Alos
- 2,657
- 5
- 35
- 47
5
votes
1 answer
How do I find the cpu the current thread is running on, for Mac and BSD?
I'm looking for a function on Mac OS and BSD that's equivalent to Linux's sched_getcpu(), and Windows' GetCurrentProcessorNumberEx() in order to implement a library for cpu-local storage. It's clearly possible to emulate this with the cpuid or…

Jeffrey Yasskin
- 5,171
- 2
- 27
- 39
4
votes
2 answers
Determining the number of available cores on a machine?
I want my software to create one thread per core, obviously different Macs have a different number of cores.
Does anyone know how to (programmatically, via Cocoa) determine the number of cores?

Geesu
- 5,928
- 11
- 43
- 72
4
votes
1 answer
multiprocessing not achieving full CPU usage on dual-processor windows machine
I am working on a dual-processor windows machine and am trying to run several independent python processes using the multiprocessing library. Of course, I am aiming to maximize the use of both CPU's in order to speed up computation time. The details…

Severin
- 281
- 2
- 8
3
votes
2 answers
How does Nvidia's Fermi GPU issue threadblocks to streaming multiprocessor
Assume I have 8 threadblocks and my GPU has 8 SMs. Then how does GPU issue this threadblocks to the SMs?
I found some programs or articles suggest a breadth-first manner, that is , each SM runs a threadblock in this example.
However, according to a…

Antony Yu
- 31
- 2