- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I have multi-core processor (Core -2 duo) which has 4 logical processors. I would like to switch processor to run the code. For example,
;Assuming code is running on CPU-0
mov eax, ecx
; I want to switchto CPU-1 (don't know how to go about it)
mov ebx, eax
; Switch back to CPU-0 here
mov ecx, eax
Note: Above is just a sample code. My intentions are to learn how to switch b/w CPU's and to set code affinity to a specific CPU
Help appreciated
Regards
Gupta
I have multi-core processor (Core -2 duo) which has 4 logical processors. I would like to switch processor to run the code. For example,
;Assuming code is running on CPU-0
mov eax, ecx
; I want to switchto CPU-1 (don't know how to go about it)
mov ebx, eax
; Switch back to CPU-0 here
mov ecx, eax
Note: Above is just a sample code. My intentions are to learn how to switch b/w CPU's and to set code affinity to a specific CPU
Help appreciated
Regards
Gupta
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This question might be handled better on the threading forum, but you should specify your OS and more about what you wish to accomplish.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Tim. I will re-ask this question in threading forum.
I was writing a test driver in Windows OS, and came across KeSetProcessorAffinity function which was forcing the code to run on a specific processor. After the call, the code somehow started running on CPU [0-3]. That made me think what could be logic behind this function call. And that was my original question.
After reading through Intel documentation, I know how interrupt routines can be executed on a dedicated processor (by setting destination bits in IOREDIRECT table - IOAPIC), but I don't know exactly how a running thread can be executed on a specific processor.
I was writing a test driver in Windows OS, and came across KeSetProcessorAffinity function which was forcing the code to run on a specific processor. After the call, the code somehow started running on CPU [0-3]. That made me think what could be logic behind this function call. And that was my original question.
After reading through Intel documentation, I know how interrupt routines can be executed on a dedicated processor (by setting destination bits in IOREDIRECT table - IOAPIC), but I don't know exactly how a running thread can be executed on a specific processor.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page