Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

execute thread on specific cpu

Name: Anonymous 2009-06-01 4:42

in a POSIX system, is there a way to execute a thread on a specific cpu and then also have this reported to the program, which cpu core it's executing on?

i'm doing this for an example application to demonstrate multi core and multi cpu systems for someone so this is nothing live or ENTERPRISE GRADE, just for fun and research.

i've seen some posts online about winlauncher being able to do this with affinity on windows. but what about posix systems? i'm using freebsd specifically.

Name: Anonymous 2009-06-02 8:37

by the way i found out you could do this with kvm_getprocs and this solved everything.

only issue now is that it might be polling a bit too fast for the kernel to update and that leads to invalid values returned in kinfo_proc->ki_oncpu but not in ki_lastcpu

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List