Question

What languages can hyper-threading be implemented in? Is it only part of Object Oriented systems or can it be implemented in C?

Thanks.

Was it helpful?

Solution

Any language and runtime that supports threads will support hyperthreading.

Hyper-threading is a way of multiplexing a CPU between multiple threads - there is only one real CPU but it is visible to the operating system as two CPU's, and thus two threads can be scheduled on it. Any stalls in the CPU on one thread (like waiting on memory, long FPU operations, etc.), allow the CPU to execute code from the other thread.

More info on hyper-threading at Wikipedia.

OTHER TIPS

Hyperthreading is for the most part the same as having more processors in a system. Even if your language does not support threads it is still possible to make your program spawn another copy of itself or spawn worker processes that will (if the operating systems supports it) be balanced over the available processors.

You need to look up thread support for your language but beware that threads can easily complicate your program and might result in hard to find bugs since the code can be executed asynchronously.

So the answer to your question is 'probably, but it depends'.

As for your other question you can easily implement multiple threads in C again depending on your runtime and compiler support. For example the OpenMP extensions http://en.wikipedia.org/wiki/OpenMP could be useful for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top