[Gc] FreeBSD threads

David Jones dej@inode.org
Fri, 21 Nov 2003 14:22:54 -0500


On November 21, 2003 01:06 pm, Boehm, Hans wrote:

> Looking at the pthread_support.c code in the most recent GC version it does
> seem to set GC_nprocs to 1, unless the environment variable GC_NPROCS is
> set. I suspect there really is some call to determine the number of
> processors, and it should be used instead.

The sysctl variable hw.ncpu might do the trick.

You can read this using the sysctl(3) library call.  Having never used the 
sysctl interface myself, I do not know exactly how to do this.