processors

availableProcessors() returns 1 for dualcore phones

我的未来我决定 提交于 2019-12-05 01:11:48
I recently bought a Moto Atrix 2 mobile. When I tried to look at the processor specs in the phone, Runtime.getRuntime().availableProcessors() returned 1. /proc/cpuinfo too had information about just processor 0. Out of curiosity I checked the same in my friend's Samsung Galaxy S2, which is again a dual core phone. This too showed that no. of cores is 1. I checked the same in my Moto xoom tablet which is again dual core. This time availableProcessors() returned 2 and cpuinfo also had both processor 0 and processor 1 details. I am confused. Why some devices carry different information? Can

Will a multi-threaded application be actually faster than a single-threaded application?

夙愿已清 提交于 2019-12-04 23:46:17
问题 All is entirely theoretical, the question just came to mind and I wasn't entirely sure whats the answer: Assume you have an application that calculates 4 independent calculations. (Totally independent, doesn't matter what order you do them and you don't need one to calculate another). Also assume those calculations are long (minutes) and CPU-bound (not waiting for any kind of IO) 1) Now, if you have a 1-processor computer, a single thread application will logically be faster than (or the same

Java: Cores available to the JVM?

爷,独闯天下 提交于 2019-12-04 05:23:06
In Java there's the method Runtime.getRuntime().availableProcessors() which has the following Javadoc: Returns the number of processors available to the Java virtual machine. This value may change during a particular invocation of the virtual machine. How can the value actually change? Under what circumstances would there be less processors available to the JVM than physically installed for example? Jonas The Linux command taskset(1) can be used to force processes to use a specific CPU or specific sets of CPUs; it is pretty easy to modify a running program to force it to one or more processors

Will a multi-threaded application be actually faster than a single-threaded application?

ぃ、小莉子 提交于 2019-12-03 14:58:15
All is entirely theoretical, the question just came to mind and I wasn't entirely sure whats the answer: Assume you have an application that calculates 4 independent calculations. (Totally independent, doesn't matter what order you do them and you don't need one to calculate another). Also assume those calculations are long (minutes) and CPU-bound (not waiting for any kind of IO) 1) Now, if you have a 1-processor computer, a single thread application will logically be faster than (or the same as) a multithreaded application. As the computer not able to do more then one thing at a time with one

What is the difference between a 32-bit and 64-bit processor?

三世轮回 提交于 2019-11-29 19:32:52
I have been trying to read up on 32-bit and 64-bit processors ( http://en.wikipedia.org/wiki/32-bit_processing ). My understanding is that a 32-bit processor (like x86) has registers 32-bits wide. I'm not sure what that means. So it has special "memory spaces" that can store integer values up to 2^32? I don't want to sound stupid, but I have no idea about processors. I'm assuming 64-bits is, in general, better than 32-bits. Although my computer now (one year old, Win 7, Intel Atom) has a 32-bit processor. All calculations take place in the registers. When you're adding (or subtracting, or

What is the difference between a 32-bit and 64-bit processor?

时光怂恿深爱的人放手 提交于 2019-11-28 15:06:00
问题 I have been trying to read up on 32-bit and 64-bit processors (http://en.wikipedia.org/wiki/32-bit_processing). My understanding is that a 32-bit processor (like x86) has registers 32-bits wide. I'm not sure what that means. So it has special "memory spaces" that can store integer values up to 2^32? I don't want to sound stupid, but I have no idea about processors. I'm assuming 64-bits is, in general, better than 32-bits. Although my computer now (one year old, Win 7, Intel Atom) has a 32-bit