cpu

Identifying the CPU architecture type using C#

时光总嘲笑我的痴心妄想 提交于 2019-12-17 09:49:43
问题 I want to check which CPU architecture is the user running, is it i386 or X64 or AMD64. I want to do it in C#. I know i can try WMI or Registry. Is there any other way apart from these two? My project targets .NET 2.0! 回答1: You could also try (only works if it's not manipulated): System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") 回答2: What led me here is checking for a 32 vs 64 bit OS. the highest rated answer is looking at the setting for the Current process . After not

x86 LOCK question on multi-core CPUs

情到浓时终转凉″ 提交于 2019-12-17 07:07:36
问题 Is it true that the x86 ASM "LOCK" command prefix causes all cores to freeze while the instruction following "LOCK" is being executed? I read this in a blog post and it doesn't make sense. I can't find anything that indicates if this is true or not. 回答1: It's about locking the memory bus for that address. The Intel 64 and IA-32 Architectures Software Developer's Manual - Volume 3A: System Programming Guide, Part 1 tells us: 7.1.4 Effects of a LOCK Operation on Internal Processor Caches. For

Difference between core and processor

筅森魡賤 提交于 2019-12-17 06:19:17
问题 What is the difference between a core and a processor? I've already looked for it on Google, but I'm just having multi-core and multi-processor definition, but it doesn't match what I am looking for. 回答1: A core is usually the basic computation unit of the CPU - it can run a single program context (or multiple ones if it supports hardware threads such as hyperthreading on Intel CPUs), maintaining the correct program state, registers, and correct execution order, and performing the operations

How do I call “cpuid” in Linux?

我怕爱的太早我们不能终老 提交于 2019-12-17 05:12:53
问题 While writing new code for Windows, I stumbled upon _cpuinfo() from the Windows API. As I am mainly dealing with a Linux environment (GCC) I want to have access to the CPUInfo. I have tried the following: #include <iostream> int main() { int a, b; for (a = 0; a < 5; a++) { __asm ( "mov %1, %%eax; " // a into eax "cpuid;" "mov %%eax, %0;" // eax into b :"=r"(b) // output :"r"(a) // input :"%eax","%ebx","%ecx","%edx" // clobbered register ); std::cout << "The code " << a << " gives " << b <<

Whole one core dedicated to single process

怎甘沉沦 提交于 2019-12-17 03:23:06
问题 Is there any way in Linux to assign one CPU core to a particular given process and there should not be any other processes or interrupt handlers to be scheduled on this core? I have read about process affinity in Linux Binding Processes to CPUs using the taskset utility but that's not solving my problem because it just try to affine the given process to that core but it is possible that other processes may be scheduled on this core and this is what I want to avoid. Should we change the kernel

GPU Emulator for CUDA programming without the hardware [closed]

三世轮回 提交于 2019-12-17 03:22:44
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 months ago . Question: Is there an emulator for a Geforce card that would allow me to program and test CUDA without having the actual hardware? Info: I'm looking to speed up a few simulations of mine in CUDA, but my problem is that I'm not always around my desktop for doing this development. I would like to do some work on

how to set CPU affinity of a particular pthread?

时光总嘲笑我的痴心妄想 提交于 2019-12-17 02:54:37
问题 I'd like to specify the cpu-affinity of a particular pthread. All the references I've found so far deal with setting the cpu-affinity of a process (pid_t) not a thread (pthread_t). I tried some experiments passing pthread_t's around and as expected they fail. Am I trying to do something impossible? If not, can you send a pointer please? Thanks a million. 回答1: This is a wrapper I've made to make my life easier. Its effect is that the calling thread gets "stuck" to the core with id core_id : //

Optimal number of threads per core

橙三吉。 提交于 2019-12-16 20:05:36
问题 Let's say I have a 4-core CPU, and I want to run some process in the minimum amount of time. The process is ideally parallelizable, so I can run chunks of it on an infinite number of threads and each thread takes the same amount of time. Since I have 4 cores, I don't expect any speedup by running more threads than cores, since a single core is only capable of running a single thread at a given moment. I don't know much about hardware, so this is only a guess. Is there a benefit to running a

Virtualization Technology Not Supported while Installing HAXM

南楼画角 提交于 2019-12-14 01:56:01
问题 I want to install HAXM on windows 8.1 (HP pavilion 3515) (I've downloaded the hotfix from here). but the below error occurs during installation (HyperV is not installed on my laptop). so I installed the "Intel processor utility to check if my laptop supports VT or not, and as you see in the second picture it says "NO". then I checked my bios and I saw "Virtualization technology" item in "configuration manager" tab! and I enabled it, and tried to install HAXM again, but I got the error again

Intel i7 replacement and possible programming [closed]

对着背影说爱祢 提交于 2019-12-13 23:21:57
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . My Toshiba laptop has just broken, I want to take out its CPU (intel i7) and place it onto my old desktop (it has windows XP). how can I remove the CPU? Do I need to reporgram my CPU for Windows XP? Can you list what stuff I need for it? 回答1: there is a very large amount of sarcasm happening here that you