gthread: how many cores do I have?

Hi everyone,

I'd my program (a threaded image processing system based on gthread)
to be able to find out how many cores the host machine has. This would
let me make my threadpools default to a sensible size. As far as I
know, this is a difficult thing to find out portably :-(

Is this something that might be considered as an addition for gthread?
I'm happy to try to make a patch if there's interest.

int g_thread_get_cores( void );

or somesuch.


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