Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.
1696 Discussions

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

eric_lee1
Beginner
290 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
290 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.

0 Kudos
Dmitry_Vyukov
Valued Contributor I
290 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.

0 Kudos
Reply