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

MONITOR/MWAIT in user-level app

falkenhagen
Beginner
664 Views
Hello,

I am trying to use MONITOR/MWAIT in a user-level application running on Linux 2.6.5. But, I'm getting an Illegal Instruction exception on them. I used CPUID to verify that MONITOR/MWAIT are supported, which, according to the Intel IA-32 manual, means that unconditional execution is supported at privilege level 0 and conditional execution is supported at privilege levels 1 through 3. So, what can I do to enable MONITOR/MWAIT support in a user-level app?

Thanks.

-- Matt
0 Kudos
2 Replies
ClayB
New Contributor I
664 Views
Matt -
Thanks for stopping into the Threading Forum with your question.
May I ask why you are hoping to use MONITOR/MWAIT in your application? What advantages do you expect to receive?
We've some discussion in the past on this topic (see http://softwareforums.intel.com/ids/board/message?board.id=42&message.id=417), and I don't think that there is any favorable situation for using these at the level you are asking about.
If you still feel you can get some performance from using these instructions, let me know and I'll see if I can find someone that is more expert in the details for you.
--clay
0 Kudos
olszewski_marek
Beginner
664 Views
I too am trying to get this to work in userspace. CPUID tells me that the feature is supported unconditionally, but I get the same illegal instruction error message. Also, I greped through the linux source code of the version that I'm running, and I couldn't find any code that disables it. What could be wrong?

I understand the implications of doing this in user space. I'm doing this purely as a feasibility study.

Marek
0 Kudos
Reply