Re: gthread: how many cores do I have?

On 03/15/2010 12:14 PM, jcupitt gmail com wrote:
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.

That would maybe work OK if only one program ran at a time, but I don't think that is a fair assumption. If I were to attack this problem I would look into porting Apple's libdispatch to Linux and go on from there. In short, the libdispatch framework is an OS level mechanism that takes care of distributing cores across programs.

 / Martin

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