Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: cpu_set_t: what's the equivalent for NetBSD?



On Thu, 15 Jan 2009, Christos Zoulas wrote:

        cpuset_t *cmask = cpuset_create();

        cpuset_zero(cmask);

Man page indicates that cpuset_create() will provide you a "clean" set to begin with, so it's superfluous to cpuset_zero() it. The code example in manpage for affinity() supports this.

        for (bitnum=0; bitnum<32; bitnum++)
                if (mask & (1<<bitnum))
                        cpuset_set(bitnum, cmask);

        ...

        cpuset_destroy(cmask);

-------------------------------------------------------------------------
|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:      |
| Customer Service | FA29 0E3B 35AF E8AE 6651 |  paul at whooppee.com   |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
|                  |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index