cpu

Conditional Jump instructions?

Doing a compiler design course: What is meant by a conditional jump instruction? I am C/C++ based programmer so if there is any code samples in that paradigm you could share to help me understand this better. What do they mean by unlimited conditional jump instructions? An example of a statement from the book: Many processors have...

Detect system architecture (x86/x64) while running

Is it possible to detect the system/processor architecture while the program is running (under windows and under linux) in c++? ...

CPUID on Intel i7 processors

I'm having an issue with my CPUID-based code on newer i7-based machines. It is detecting the CPU as having a single core with 8 HT units instead of 4 cores each with 2 HT units. I must be misinterpreting the results of the CPUID information coming back from the CPU, but I can't see how. Basically, I iterate through each processor visi...

Example of CPU and I/O burst cycle?

Can somebody give me an example of CPU and I/O burst cycle? I know the CPU must do its calculation during the burst, but how about the I/O? What actually happens during the I/O time? ...

Why does my Python daemon hog all my CPU while sleeping?

I'm using this recipe: http://code.activestate.com/recipes/278731/ on an Ubuntu server. I make a daemon instance like this: class MyDaemon(Daemon): def run(self): while True: try: do_my_data_processing() except MySQLdb.OperationalError: # Sleep an extra 30 second...

CPUID implementations in C++

Hi, I would like to know if somebody around here has some good examples of a C++ CPUID implementation that can be referenced from any of the managed .net languages. Also, should this not be the case, should I be aware of certain implementation differences between X86 and X64? I would like to use CPUID to get info on the machine my sof...

Multiple threads and memory

I read in the Visual C++ documentation that it is safe for multiple threads to read from the same object. My question is: how does a X86-64 CPU with multiple cores handle this? Say you have a 1 MB block of memory. Are different threads literally able to read the exact same data at the same time or do cores read one word at a time with ...

Debugging high cpu usage

So I have an issue on our production environment where 2 threads have been running for like 9 hours and 5 hours and they are causing the cpu usage to stay around 99% I've included the stack trace from !Clrstack and kb 2000 I've been trolling around google and etc... forever and I can't find anything that helps me figure out what these t...

MySQL process uses more than 100% CPU usage and need about 1 GB of memory

I am running MySQL server on the server's which has following specifications - Dual Xeon Quad Core 2.0, 2048 MB RAM, 1x 160 GB SATA Fedora Core + SSH But MySQL process for inserting 10000 records take more than 100% of CPU and up to 1 GB of RAM. It's a plain insert statement. Why is MySQL is taking so much of memory and what can done...

How to retrieve cpu usage per process

Hi All, There is a PerformanceCounter in .net platform, which can retrieve the cpu usage of every single process. Is there any similar solution in delphi? Note that the names of all processes are already available. ...

Diagnosing runaway CPU in a .Net production application

Does anyone know of a tool that can help me figure out why we are seeing runaway CPU in a managed app? What I am not looking for: Process explorer, it has this awesome feature that lets you see CPU per thread, but you do not get managed stack traces. Also, it requires a fairly proficient user. Windbg + SOS, it could probably be used ...

Optimal number of threads per core

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 the a sin...

How to speed up Visual Studio 2008? Add more resources?

Hello, I'm using Visual Studio 2008 (with the latest service pack) I also have ReSharper 4.5 installed. ReSharper Code analysis/ scan is turned off. OS: Windows 7 Enterprise Edition It takes me a long time (2 minutes) to run the debugger, compiler, and if I save a file in my app_code folder it locks up for 2 minutes. I have 12 Gb of r...

Will the comparison of two float numbers consume more CPU time than two ints?

Will the comparison of two float numbers consume more CPU time than two ints? ...

Django development server CPU intensive - how to analyse?

Hi folks, I'm noticing that my django development server (version 1.1.1) on my local windows7 machine is using a lot of CPU (~30%, according to task manager's python.exe entry), even in idle state, i.e. no request coming in/going out. Is there an established way of analysing what might be responsible for this? Thanks! Martin ...

Using cpulimit from within PHP

I have a script that's scheduled to run periodically on a customers production server to import some data from their FTP server. This needs to run as scheduled, even during the day when the customer is working. Occasionally, the script takes up large amounts of CPU which slows down the customers production environment. I thought I cou...

CPU cache flush

I am interested in forcing a CPU cache flush in Windows (for benchmarking reasons, I want to emulate starting with no data in cpu cache), preferably a basic C implementation or win32 call. Is there a known way to do this with a system call or even something as sneaky as doing say a large memcopy? Intel i686 platform (P4 and up is okay as...

Using Java to retrieve the CPU Usage for Window's Processes

Hello all, I am looking for a Java solution to finding the CPU usage for a running process in Windows. After looking around the web, there seems to be little information on a solution in Java. Keep in mind, I am not looking to find the CPU usage for the JVM, but any process running in Windows at the time. I am able to retrieve the memo...

CPU running time of a portion of code

Hi I would like to know the CPU time used by a portion of code.( I am aware of the time command in linux, but that would give me the running time of the complete program, not a portion of it.) Is there any function/command that can help me achieve this. Thanks ...

C - the limits of speed of the Desktop-CPUs if program is build using GCC with all optimization flags?

We are planning to port a big part of our Digital Signal Processing routines from hardware-specific chips to the common desktop CPU architecture like Quad-Core or so. I am trying to estimate the limits of such architecture for a program build with GCC. I am mostly interested in a high SDRAM-CPU bandwidth [Gb/sec] and in a high number of ...