cpu

Elegant and safe way to determine if architecture is 32bit or 64bit

As title says, is there any elegant and safe way to determine if architecture is 32bit or 64bit. By elegant, you can think of precise, correct, short, clean, and smart way. By safe, think of safe in term of standard, C89/C99, and operating system independence. ...

Detect CPU Speed/Memory/Internet Speed using Java?

Is it possible within Java to identify the total CPU speed available as well as the total system memory? Network connection speed to the web would also be awesome. ...

CPU consumption equivalent for harddisk scanning.

I would like my software that scans disk structure to work in background but lowing the priority for the thread that that scans disk structure doesn't work. I mean you still have the feeling of the computer hard working and even freezing even if your program consumes only 1 percent of the processor time. Is it possible to implement "hard...

Is the stack width always same as CPU register size?

For example, for a 8-bit CPU, the stack size is expected to be 8-bit wide, and 16-bit CPU vs 16-bit stack width, and 32-bit, 64-bit CPU, and so on. Is it true for all architectures? ...

Multi-threaded Queue in C#

I've been tasked with working on a download queuing system but I'm a bit confused about where to start. Essentially what we need to do is to have something like a download manager (but not as fully blown). We have about 20-100 files to download, we give the user a UI (with a listview) to allow them to pause, stop, or move the priorty of...

Programs run in 2 seconds on my machine but 15 seconds on others.

I have two programs written in C++ that use Winsock. They both accept TCP connections and one sends data the other receives data. They are compiled in Visual Studio 2008. I also have a program written in C# that connects to both C++ programs and forwards the packets it receives from one and sends them to the other. In the process it coun...

ISR - Maximum Data Rate

The interrupt service routine (ISR) for a device transfers 4 bytes of data from the device on each device interrupt. On each interrupt, the ISR executes 90 instructions with each instruction taking 2 clock cycles to execute. The CPU takes 20 clock cycles to respond to an interrupt request before the ISR starts to execute instructions. Ca...

Programmable USB dongles

Where can I buy a programmable USB dongle that supports C as a development language? ...

how to set CPU affinity of a particular pthread?

Hi, 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 ple...

How to programmatically control the CPU utilization by an C# winform application

Is there any way we can cap the maximum allowed CPU utilization by a windows application developed in C# .NET apart from the thread mentioned at posting http://stackoverflow.com/questions/261089/controlling-cpu-utilization ...

How to get max CPU clock in Java

Hi, with Runtime.getRuntime().availableProcessors(); I can get the numbers of CPU avaiable. But how can I get their clock frequency? I was searching for a os-indipendent solution. ...

How to detect iPhone CPU speed?

I have an aesthetic UI element, a reflection, that works well on the iPhone 3Gs and iPod Touches, but is too slow on the 3G and prior. How best can I detect CPU speed so I can disable this function? ...

Lookup CPU type in .NET Compact Framework

I need to be able to lookup the type of CPU that my application is running from a .NET Compact Framework application. Basically, I need to know if I'm on an ARM, SH4, x86, etc processor. ...

Linux Process States

In Linux, what happens to the state of a process when it needs to read blocks from a disk? Is it blocked? If so, how is another process chosen to execute? ...

Is an Intel i7 (4 cores, 8 HT-based logical cores) better than an Intel Core 2 Quad for VisualC++ development?

I have to make a recommendation to management regarding whether or not we should spend the extra money to purchase new computers with Intel i7 CPUs (i7 950s) or whether we should buy Intel Core 2 Quad processors (Q9550s or something equivalent.) Our main task are Microsoft Visual C++ development, thus we are aiming to ensure the best co...

Virtual Server and Sharing CPU Resources

Is there a program out there that allows me to use my computer resources for two different users simultaneously? Specifically, I'd like to hook up two different monitors, keyboards, and mice to one computer so that two people can be working independently on two instances of an operating system. A Windows solution is preferred, but Linux ...

FLOPS Intel core and testing it with C (innerproduct)

Hey everyone, I have some misconceptions about measuring flops, on Intel architecture, is a FLOP one addition and one multiplication together? I read about this somewhere online and there is no debate that could reject this. I know that FLOP has a different meaning on different types of cpu. How do I calculate my theoretical peak FLOP...

Does a one cycle instruction take one cycle, even if RAM is slow?

Hi! I am using an embedded RISC processor. There is one basic thing I have a problem figuring out. The CPU manual clearly states that the instruction ld r1, [p1] (in C: r1 = *p1) takes one cycle. Size of register r1 is 32 bits. However, the memory bus is only 16 bits wide. So how can it fetch all data in one cycle? ...

DispatcherTimer eating up CPU over time causing WPF visual not rendering properly

I have a WPF app that uses DispatcherTimer to update a clock tick. However, after my application has been running for approx 6 hours the clocks hands angles no longer change. I have verified that the DispatcherTimer is still firing with Debug and that the angle values are still updating, however the screen render does not reflect the ch...

How many instructions per cycle do amd k8 CPUs have?

How many instructions per cycle do amd k8 (preferably amd turion x2 64, if it matters) CPUs have? I looked everywhere and I can't find it. ...