processor

How can I programmatically determine my processor type?

强颜欢笑 提交于 2019-12-01 05:14:20
How can I determine programmatically whether my machine is an x86, x64 or an IA64? On Windows Systems you can get the environment variable PROCESSOR_ARCHITECTURE. Here is an MSDN article explaining the values that can be returned. PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_ARCHITECTURE=IA64 PROCESSOR_ARCHITECTURE=x86 VBScript, checking the PROCESSOR_ARCHITECTURE environment variable: Set oShell = CreateObject("WScript.Shell") Set oEnv = oShell.Environment("System") Select Case LCase(oEnv("PROCESSOR_ARCHITECTURE")) Case "x86" ' x86 Case "amd64" ' amd64 Case "ia64" ' ia64 Case Else ' other End

How can I get the processor NAME of my machine using C#(.NET 3.5)?

ぃ、小莉子 提交于 2019-12-01 04:58:11
I need to find the Name and speed of the processor on my machine. I'm building an open source help desk suite and finding this really entertaining! Thanks for the help guys! As the others have pointed out, using WMI. Do this by adding a reference to System.Management.dll, then calling the following code: ManagementObjectSearcher mos = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_Processor"); foreach (ManagementObject mo in mos.Get()) { Console.WriteLine(mo["Name"]); } Besides "Name", WMI also exposes other interesting facts about your processor. Take a look at http://msdn

How are shifts implemented on the hardware level?

耗尽温柔 提交于 2019-12-01 02:56:48
How are bit shifts implemented at the hardware level when the number to shift by is unknown? I can't imagine that there would be a separate circuit for each number you can shift by (that would 64 shift circuits on a 64-bit machine), nor can I imagine that it would be a loop of shifts by one (that would take up to 64 shift cycles on a 64-bit machine). Is it some sort of compromise between the two or is there some clever trick? The circuit is called a " barrel shifter " - it's a load of multiplexers basically. It has a layer per address-bit-of-shift-required, so an 8-bit barrel shifter needs

How can I programmatically determine my processor type?

╄→尐↘猪︶ㄣ 提交于 2019-12-01 02:20:33
问题 How can I determine programmatically whether my machine is an x86, x64 or an IA64? 回答1: On Windows Systems you can get the environment variable PROCESSOR_ARCHITECTURE. Here is an MSDN article explaining the values that can be returned. PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_ARCHITECTURE=IA64 PROCESSOR_ARCHITECTURE=x86 回答2: VBScript, checking the PROCESSOR_ARCHITECTURE environment variable: Set oShell = CreateObject("WScript.Shell") Set oEnv = oShell.Environment("System") Select Case LCase

Symfony2 : use Processors while logging in different files

橙三吉。 提交于 2019-12-01 00:26:45
I want to write my application logs in another file than the one Symfony2 writes its own logs and system logs. I understood that I needed to create a service of my own like this : services: actionslogger: class: Symfony\Bridge\Monolog\Logger arguments: [app] calls: - [pushHandler, [@actionslogger_handler]] actionslogger_handler: class: Monolog\Handler\StreamHandler arguments: [%kernel.logs_dir%/actions_%kernel.environment%.log, 200] That works fine when I use $logger = $this->get('actionslogger'); in my application, so that's ok. But I also want to use a Formatter and a Processor to manage the

setting processor affinity with C++ that will run on Linux [duplicate]

孤街醉人 提交于 2019-11-30 23:27:05
Possible Duplicate: CPU Affinity I'm running on Linux and I want to write a C++ program that will set 2 specific processors that my 2 applications that will run in parallel (i.e. setting each process to run on a different core/CPU). I want to use processor affinity tool with C++. Please can anyone help with C++ code. From the command line you can use taskset(1) , or from within your code you can use sched_setaffinity(2) . E.g. #ifdef __linux__ // Linux only #include <sched.h> // sched_setaffinity #endif int main(int argc, char *argv[]) { #ifdef __linux__ int cpuAffinity = argc > 1 ? atoi(argv

How are shifts implemented on the hardware level?

我与影子孤独终老i 提交于 2019-11-30 22:48:01
问题 How are bit shifts implemented at the hardware level when the number to shift by is unknown? I can't imagine that there would be a separate circuit for each number you can shift by (that would 64 shift circuits on a 64-bit machine), nor can I imagine that it would be a loop of shifts by one (that would take up to 64 shift cycles on a 64-bit machine). Is it some sort of compromise between the two or is there some clever trick? 回答1: The circuit is called a "barrel shifter" - it's a load of

How can i stress my phone's CPU programatically?

若如初见. 提交于 2019-11-30 20:41:01
So i overclocked my phone to 1.664ghz and I know there are apps that test your phone's CPU performance and stressers but I would like to make my own someway. What is the best way to really make your CPU work? I was thinking just making a for loop do 1 million iterations of doing some time-consuming math...but that did not work becuase my phone did it in a few milliseconds i think...i tried trillions of iterations...the app froze but my task manager did not show the cpu even being used by the app. Usually stress test apps show up as red and say cpu:85% ram: 10mb ...So how can i really make my

Is Intel QuickPath Interconnect (QPI) used by processors to access memory?

扶醉桌前 提交于 2019-11-30 17:09:44
问题 I have read An Introduction to the Intel® QuickPath Interconnect. The document does not mention that QPI is used by processors to access memory. So I think that processors don't access memory through QPI. Is my understanding correct? 回答1: Yes, QPI is used to access all remote memory on multi-socket systems, and much of its design and performance is intended to support such access in a reasonable fashion (i.e., with latency and bandwidth not too much worse than local access). Basically, most

Compiling using arm-none-eabi-gcc and linking library liba.a error

*爱你&永不变心* 提交于 2019-11-30 15:11:19
问题 I am compiling a hello world program in C on a 64-bit Linux machine. I am using a GCC ARM embedded toolchain to cross compile my program on a FOX G20 V board with an ATMEL AT91SAM9G20 processor. On the first take, I had a few errors when compiling because the program didn't recognize the printf, return etc. functions (the standard C functions). So I decided to make the link between the functions, which I believe are defined in the libc.a library (correct me if I'm wrong), by doing arm-none