Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
1685 Discussions

How can I obtain the content of another Logic CPU's register?

eric_lee1
Beginner
86 Views
In a hyper-threading processor, are there any ways to get the content of another logic CPU's register at runtime? For example, in a hyper-threading processor, is there any ways that the foreground thread can obtain the register content of background thread?

Thanks!
0 Kudos
2 Replies
robert-reed
Valued Contributor II
86 Views
Quoting - eric_lee
In a hyper-threading processor, are there any ways to get the content of another logic CPU's register at runtime? For example, in a hyper-threading processor, is there any ways that the foreground thread can obtain the register content of background thread?

Thanks!

Not really. The processors are logically distinct but they are distinct none the less. There is no foreground or background thread--they are truly peers that share physical hardware with sufficient status to preserve theirlogical separation.

Dmitry_Vyukov
Valued Contributor I
86 Views
Quoting - eric_lee
In a hyper-threading processor, are there any ways to get the content of another logic CPU's register at runtime? For example, in a hyper-threading processor, is there any ways that the foreground thread can obtain the register content of background thread?

Thanks!

On Windows you can always suspend thread with SuspendThread(), and then receive thread context with GetThreadContext(). From obtained CONTEXT structure you can get contents of any register. However I'm not sure whether it's what you are looking for or not.

Reply