CPUID multicore

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
coolcoolm
Posts: 5
Joined: Sun Aug 23, 2009 12:48 am

CPUID multicore

Post by coolcoolm »

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

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;
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: CPUID multicore

Post by Combuster »

If you need a processor-specific value, try the task register.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply