Re: gthread: how many cores do I have?



Hi!

> > And then the valid question is... should the api also count virtual
> > cpus from hyperthreading (aka smt?)?
> 
> BOTH should be available.  If we're spinning up threads to perform some processing, then we need to count those virtual cores.  But if we're starting a child program to perform some processing, then we need to know the count of real cores instead.
> 

Actually, SMT machine can execute threads from different processes at
the same time; so you should use number of virtual processors for
children, too.

									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]