processor

C++ get Processor ID

China☆狼群 提交于 2019-11-29 00:10:31
This thread is ok. How to get Processor and Motherboard Id? I wanted to get processor ID using C++ code not using WMI or any third party lib. OR anything on a computer that turns out to be unique. One thing is Ethernet ID but which is again removable on some machines. This I want to use mostly for licensing purpose. Is processor ID unique and available on all major processors? I had a similar problem lately and I did the following. First I gained some unique system identification values: GetVolumeInformation for HDD serial number GetComputerName (this of course is not unique, but our system

Using SSE instructions

岁酱吖の 提交于 2019-11-28 16:46:34
问题 I have a loop written in C++ which is executed for each element of a big integer array. Inside the loop, I mask some bits of the integer and then find the min and max values. I heard that if I use SSE instructions for these operations it will run much faster compared to a normal loop written using bitwise AND , and if-else conditions. My question is should I go for these SSE instructions? Also, what happens if my code runs on a different processor? Will it still work or these instructions are

Polling or Interrupt based method

拥有回忆 提交于 2019-11-28 15:59:11
When should one use polling method and when should one use interrupt based method ? Are there scenarios in which both can be used ? If the event of interest is: Asynchronous Urgent Infrequent then an interrupt based handler would make sense. If the event of interest is: Synchronous (i.e. you know when to expect it within a small window) Not Urgent (i.e. a slow polling interval has no ill effects) Frequent (i.e. majority of your polling cycles create a 'hit') then polling might be a better fit. Other considerations include whether you are writing a device driver for an OS or just writing bare

what is difference between Superscaling and pipelining?

旧时模样 提交于 2019-11-28 15:21:18
问题 Well looks too simple a question to be asked but i asked after going through few ppts on both. Both methods increase instruction throughput. And Superscaling almost always makes use of pipelining as well. Superscaling has more than one execution unit and so does pipelining or am I wrong here? 回答1: Superscalar design involves the processor being able to issue multiple instructions in a single clock, with redundant facilities to execute an instruction. We're talking about within a single core,

Good resources on how to program PEBS (Precise event based sampling) counters?

你。 提交于 2019-11-28 12:53:34
I have been trying to log all memory accesses of a program, which as I read seems to be impossible. I have been trying to see to what extent can I go to log atleast a major portion of the memory accesses, if not all. So I was looking to program the PEBS counters in such a way that I could see changes in the number of memory access samples collected. I wanted to know if I can do this by modifying the counter-reset value of PEBS counters. (Usually this goes to zero, but I want to set it to a higher value) So I was looking to program these pebs counters on my own. Has anybody had experience

Is it possible to know the address of a cache miss?

人走茶凉 提交于 2019-11-28 11:23:05
Whenever a cache miss occurs, is it possible to know the address of that missed cache line? Are there any hardware performance counters in modern processors that can provide such information? Yes, on modern Intel hardware there are precise memory sampling events that track not only the address of the instruction, but the data address as well. These events also includes a great deal of other information, such as what level of the cache hierarchy the memory access was satisfied it, the total latency and so on. You can use perf mem to sample this information and produces a report. For example,

How is arctan implemented?

家住魔仙堡 提交于 2019-11-28 07:00:43
Many implementation of the library goes deep down to FPATAN instuction for all arc-functions. How is FPATAN implemented? Assuming that we have 1 bit sign, M bits mantissa and N bits exponent, what is the algorithm to get the arctangent of this number? There should be such algorithm, since the FPU does it. Trigonometric functions do have pretty ugly implementations that are hacky and do lots of bit fiddling. I think it will be pretty hard to find someone here that is able to explain an algorithm that is actually used. Here is an atan2 implementation: https://sourceware.org/git/?p=glibc.git;a

Multiple Processors and PerformanceCounter C#

有些话、适合烂在心里 提交于 2019-11-28 04:08:44
问题 I'm trying to figure out how to gather the current usage percentage of each individual processor on my computer. If I use "System.Environment.ProcessorCount;" I can get the number of processors on my computer and it currently returns "2". I either don't know what I'm looking for or there isn't very much info about this on the internet. The following is the code I'm currently using to get the total current usage percentage of all processors combined. protected PerformanceCounter cpuCounter =

Identify processor (core) is used by specific thread

元气小坏坏 提交于 2019-11-28 03:54:18
问题 I would like to know if it is possible to identify physical processor (core) used by thread with specific thread-id ? For example, I have a multithreaded application that has two (2) threads ( thread-id = 10 and thread-id = 20 , for instance). I run the application on a system that has a dual core processor (core 1 and core 2). So, how do I to get core number used by thread with thread-id = 20 ? P.S. Windows platforms. Thank you, Denis. 回答1: Unless you use thread-affinity, threads are not

What's the difference between a single precision and double precision floating point operation?

感情迁移 提交于 2019-11-28 02:32:03
What is the difference between a single precision floating point operation and double precision floating operation? I'm especially interested in practical terms in relation to video game consoles. For example, does the Nintendo 64 have a 64 bit processor and if it does then would that mean it was capable of double precision floating point operations? Can the PS3 and Xbox 360 pull off double precision floating point operations or only single precision and in general use is the double precision capabilities made use of (if they exist?). VonC Note: the Nintendo 64 does have a 64-bit processor,