cpu

Why do Off-the-shelf applications work on both Intel and AMD processors?

One thing I lack understanding on is how can code compiled for an Intel CPU work on an AMD CPU. My base understanding is that if you compile C code, for example, the compiler turns the source code into machine language which will have instructions for a particular processor. So, you need to compile with a compiler for whatever platform ...

Is it safe to allocate logical CPUs to a VM after creation

We're going to be serving our portal software on a virtual machine running Centos 5.2 on VMWare ESXi. We're initially going to allocate two logical CPUs but there's a possibility that we might want to add an additional two some time in the future. We don't want to allocate all resources at this time because a few VMs are fighting for sp...

Is there any suggestions about cutting cpu usage in Java?

I wrote a Java program to download HTML page. But CPU usage is near to 100%, while network utilization is lower than 3%. It seems like that CPU became my bottleneck. So is there any suggestions about cutting my CPU usage. ...

will mmap use user cpu instead of whole sys cpu? (solaris)

when use mmap to allocate some anonymous mem, we often set the start address as 0/null so mmap will figure out the starting address by itself. And to get the start address, it will work thought the whole virtual memory space to find a hole which could put the chuck of mem to be allocated. I guess this is calculated as user cpu instead of...

What exactly is CPU Time in task manager?

I have some WCF services that are hosted in a windows service. Yesterday I looked at Task Manager and noticed that the CPU time for my windows service process was over 5 hours, while the majority of all other processes were at 0. What does that mean? Should I be concerned that the CPU Time was 5+ hours? ...

Real Mode, Interrupt vector replacement Crashing

I'm trying to learn more about how systems really work underneath all the pretty graphics on top. So I'm currently playing with memory in the 512bytes that the BIOS loads on startup, can't really call it a bootloader at the moment I guess. Anyway, I'm replacing an interrupt vector but having issues with it. After replacing interupt 09h (...

How to get CPU Utilization metrics in Windows Xp ?

Hi All, I need to get CPU utilization metrics of all the process. Operating system = Windows Xp programming language = Java requirements = need to take samples every few seconds indefinitely, not just for one snapshot in time. ...

How to determine the hardware (CPU and RAM) on a machine?

I'm working on a cross platform profiling suite, and would like to add information about the machine's CPU (architecture/clock speed/cores) and RAM(total) to the report of each run. Currently I need to target Windows and Unix, so I need methods to obtain this information from both platforms, any clues? Edit: Thanks for the great answers...

Intel Core for a C programmer

First Question From a C programmer's point of view, what are the differences between Intel Core processors and their AMD equivalents ? Related Second Question I think that there are some instructions that differentiate between the Intel Core from the other processors and vis-versa. How important are those instructions ? Are they being t...

What is faster (x < 0) or (x == -1)?

Variable x is int with possible values: -1, 0, 1, 2, 3. Which expression will be faster (in CPU ticks): 1. (x < 0) 2. (x == -1) Language: C/C++, but I suppose all other languages will have the same. P.S. I personally think that answer is (x < 0). More widely for gurus: what if x from -1 to 2^30? ...

In Silverlight does DateTime get affected if the client-side CPU is overclocked?

In an Silverlight application, if the client-side CPU is overclocked, would the DateTime structure return the correct time? ...

Which Java thread is hogging the CPU?

Let's say your Java program is taking 100% CPU. It has 50 threads. You need to find which thread is guilty. I have not found a tool that can help. Currently I use the following very time consuming routine: Run jstack <pid>, where pid is the process id of a Java process. The easy way to find it is to run another utility included in the ...

how to write super fast file streaming code in C# ?

I have to split huge file into many smaller files. each of the destination file is defined by offset and length as number of bytes. I'm using the following code: private void copy(string srcFile, string dstFile, int offset, int length) { BinaryReader reader = new BinaryReader(File.OpenRead(srcFile)); reader.BaseStream.Seek(offse...

What does "multicore" assembly language look like?

Once upon a time, to write x86 assembler, for example, you would have instructions stating "load the EDX register with the value 5", "increment the EDX" register, etc. With modern CPUs that have 4 cores (or even more), at the machine code level does it just look like there are 4 separate CPUs (i.e. are there just 4 distinct "EDX" regist...

What does this line mean in Python?

Which CPU information this code is trying to retrieve. This code is part of a larger package. I am not a Python programmer, and I want to convert this code to C#. from ctypes import c_uint, create_string_buffer, CFUNCTYPE, addressof CPUID = create_string_buffer("\x53\x31\xc0\x40\x0f\xa2\x5b\xc3") cpuinfo = CFUNCTYPE(c_uint)(addressof(CP...

read CPU cache contents

Hi, Is there any way to read the CPU cache contents? Architecture is for ARM. I m invalidating a range of addresses and then want to make sure whether it is invalidated or not. Although I can do read and write of the range of addresses with and without invalidating and checking the invalidation, I want to know whether it is possible to ...

Scheduling

Schedulers in contemporary operating systems implicitly give higher priority to I/O bound process over CPU bound processes. Do you think that while scheduling the processes, CPU bound processes should be given higher priority as compared to I/O bound processes so that the throughput could be increased. ...

Keeping your code in L1 cache

I have been reading Wikipedia's article on K programming language and this is what I saw: The small size of the interpreter and compact syntax of the language makes it possible for K applications to fit entirely within the level 1 cache of the processor. I am intrigued. How is it possible to have the whole program in L1 cache? Say,...

how to set CPU affinity of a program?

Hello everyone, I have a program written in C#, I am using VSTS 2008 + .Net 3.5 + Windows Vista Enterprise x86 to develop a Windows Forms application. My current computer is dual-core CPU, I want to set CPU affinity of my program to run on a specific CPU and free another CPU to do some other job. Any ideas how to do this? Either throug...

How to get CPU usage or disk usage of application using Windows API from C++?

How to proceed to get CPU usage or disk usage of application using API in C++??? I want to get the highest CPU usage or disk usage among the application running on windows. I have tried to find out API but there is no direct API for that. Can anyone please let me know how to proceed for this in C++. ...