January 24, 2007
Kevin Bealer kirjoitti:
> == Quote from Jari-Matti_Mäkelä (jmjmak@utu.fi.invalid)'s article
>> Kristian Kilpi kirjoitti:
>>> BTW, is there a way to know the number of hardware threads (and maybe
>>> the number of CPUs)?
>> std.cpuid has threadsPerCPU(). See
>> http://www.digitalmars.com/d/phobos/std_cpuid.html.
>>
>> How does one know how many hw threads there are available, if two multi-threaded programs are running?
> 
> My tendency would be for each program to use enough threads to utilize all the hardware threads.  This means that there will be more threads running than CPUs exist, but I don't see extra threads as especially harmful.  This is even more true if one or the other application is sometimes idle.

Yeah, this is probably the best for desktop use, where the machine is idle or running just one CPU intensive program (e.g. a game) most of the time.

> I think this is the case for most programs on a desktop machine.  For server farms, more tuning is required, and most workloads are already pretty well optimized for the specific hardware.

Yup.

> 
> (But see also the latest changes to futurism.)

Very nice. This is now much better than creating verbose worker
constructs for every parallel operation (Java) or overly complex FSM's
using interrupts and timers like in the good old times (DOS games).
January 27, 2007
Kristian Kilpi wrote:
> (I think one should, in general, always use thread counts relative to the number of hardware threads.)

Multithreaded code can speed up computation even on a machine with only one CPU, because of how I/O blocking works.
January 27, 2007
Walter Bright wrote:
> Kristian Kilpi wrote:
>> (I think one should, in general, always use thread counts relative to the number of hardware threads.)
> 
> Multithreaded code can speed up computation even on a machine with only one CPU, because of how I/O blocking works.

So? You may still want twice as many threads if you've got twice the hardware threads, which is what Kristian was saying.
"relative to" != "equal to" :p.
January 27, 2007
Frits van Bommel wrote:
> Walter Bright wrote:
>> Kristian Kilpi wrote:
>>> (I think one should, in general, always use thread counts relative to the number of hardware threads.)
>>
>> Multithreaded code can speed up computation even on a machine with only one CPU, because of how I/O blocking works.
> 
> So? You may still want twice as many threads if you've got twice the hardware threads, which is what Kristian was saying.
> "relative to" != "equal to" :p.

Ok.
1 2 3
Next ›   Last »