Futurism lib (futures in D)

Jari-Matti Mäkelä jmjmak at utu.fi.invalid
Wed Jan 24 14:00:23 PST 2007


Kevin Bealer kirjoitti:
> == Quote from Jari-Matti_Mäkelä (jmjmak at 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).



More information about the Digitalmars-d-announce mailing list