CPUID multicore
Posted: Fri May 14, 2010 11:43 am
I'm trying to find an alternate way to do spinlock without the chance of the computer of locking up. I thought of a way to use a process list with a field called cpuid. When a processor picks up a process it sets cpuid to its processor id and when the process is finished it clears cpuid. I would most likely have to put a little second cpuid check in it but that isn't the problem I need to find something thats different in the CPUID in multicore processors so I can check them. I would prefer to find a way to do it with CPUID but if i have to i would try to enumerate them but i wouldn't know where to begin there. So can anybody help.
and here's the current process structure
and here's the current process structure
Code: Select all
typedef struct _h_process {
DWORD processid; //process ID
char name[256]; //name of the process
DWORD priority; //process priority(hi,medium,low)
DWORD status; //status of the process
DWORD syssize; //size of the system stack
processmem *meminfo; //memory locations
void *stackptr,*stackptr0; //stack pointers
char *parameters; //parameters passed to this process
char *environment; //environment variables
char *cpuid; //active cpuid
} h_process;