Full Re-Write/Update for clarity (and your sanity, its abit too long) ... (Old Post)
For an assignment, I need to find the levels (L1,L2,...) and si
For windows, you can use the GetLogicalProcessorInformation method.
For linux, you may use sysconf(). You can find valid arguments for sysconf in /usr/include/unistd.h or /usr/include/bits/confname.h
sysconf()
sysconf
/usr/include/unistd.h
/usr/include/bits/confname.h